Skip to content

Conversation

@luispadron
Copy link
Collaborator

@luispadron luispadron commented Nov 11, 2025

Fixes #769

Adds support for a non-root bzlmod module B that uses rules_swift_package_manager to define it's Swift dependencies to be depended upon by another module A which also uses rules_swift_package_manager.

The main issues are:

  • swift_deps_info and swift_package repositories 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 how from_package is 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_overides in from_package.

@luispadron luispadron force-pushed the luis/support-rules_spm-in-bzlmod-dep-graph branch from 4df4c1b to 4b2adb9 Compare November 11, 2025 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support depending on Bazel modules which also use rules_swift_package_manager

2 participants