How can I work with local Swift packages which are transitive dependencies better?

I work with a dependency graph where I'd like to fix a bug in a transitive dependency. I have been doing this by pulling down each package which leads to that dependency and creating a branch from the release tag and modifying the target requirements to use the branch instead of the release tag. This means if I have a dependency 3 or 4 levels deep I need to bring in all of those packages and set them all up to use them.

Is there another way to use a local package which is a transitive dependency without bringing in the whole graph leading to it? Is there a way to use the release tag with a local package?

You can use a Swift Workspace to replace the remote transitive dependency with a local copy temporarily as described in this post I wrote.

If you want to do this via VSCode, you can do that as well

1 Like

Thanks, I had trouble resolving dependencies when the local branch did not match the package requirement. It appears that is not the case as I work with Xcode 13.4.1 now. I may have just had an issue with resolving packages at one point and making it explicit got it to resolve for me.

I also reset the package cache and have Xcode resolve dependencies from the File menu more often now to get into a good state.