feat: support depending on bzlmod deps that use rules_swift_package_manager #1914
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #769
Adds support for a non-root bzlmod module B that uses
rules_swift_package_managerto define it's Swift dependencies to be depended upon by another module A which also usesrules_swift_package_manager.The main issues are:
swift_deps_infoandswift_packagerepositories are currently generated even for non-root modules where they likely have no use.These should be dev dependencies, so they're only available to the root module and can't be declared more than once in the bzlmod graph. This requires declaring the extension as
dev_dependency = True. We likely need to re-design howfrom_packageis used and/or add a new api (ex:swift_dev_deps.from_package_extras(declare_swift_package = True)).swiftpkg_*repositories are declared even if they have already been declared by another bzlmod module.We need to update our logic to support resolving dependencies declared in more than one bzlmod module. We should potentially match bzlmod resolution logic here and support
single_version_overidesinfrom_package.