Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bzlmod): allow users to specify extra targets to be added to hub repos #2369

Merged
merged 10 commits into from
Nov 5, 2024

Conversation

aignas
Copy link
Collaborator

@aignas aignas commented Nov 4, 2024

Before this change, it was impossible for users to use the targets
created with additive_build_content whl annotation unless they relied
on the implementation detail of the naming of the spoke repositories and
had use_repo statements in their MODULE.bazel files importing the
spoke repos.

With #2325 in the works, users will have to change their use_repo
statements, which is going to be disruptive. In order to offer them an
alternative for not relying on the names of the spokes, there has to be
a way to expose the extra targets created and this PR implements a
method. Incidentally, the same would have happened if we wanted to
stabilize the #260 work and mark experimental_index_url as
non-experimental anymore.

I was hoping we could autodetect them by parsing the build content
ourselves in the pip extension, but it turned out to be extremely
tricky and I figured that it was better to have an API rather than not
have it.

Whilst at it, also relax the naming requirements for the
whl_modifications attribute.

Fixes #2187

…the values of the extra aliases field to be passed to the hub repo, because I have no visibility into what annotatinos are passed to what hubs, because of how the code is structured today. Lets just ask the user to specify those explicitly
@aignas aignas added this pull request to the merge queue Nov 5, 2024
Merged via the queue into bazelbuild:main with commit 218f8e1 Nov 5, 2024
4 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Nov 19, 2024
The extra_hub_aliases feature from #2369 has bindings in the pip
extension
for bzlmod users, but not pip_repository for WORKSPACE users.  But it
_can_ work for either, so this patch moves it to the list of attrs the
two share and makes it work with the latter.

---------

Co-authored-by: Ignas Anikevicius <[email protected]>
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.

package_annotation additive_build_content doesn't add new target to pip hub repo
2 participants