-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
use_repo name remapping limits the space of possible target workspace names #19635
Comments
I don't have any better idea than selectively allowing |
Other options that come to mind:
|
One more alternative would be to accept pairs as positional arguments: |
I was also thinking of just allowing a map to be passed, like |
Nice, I like the dict option. |
Personal opinion here is that I found the kwarg based API a bit clunky, could we improve this somehow, maybe with structs? +1 to dict, or some escape hatch. As a "practical" example, I tried to use |
Edit: Ignore this, it's the wrong way round. @luispadron Are you referring to overriding a repo |
Description of the feature request:
use_repo
, called inMODULE.bazel
to import an external workspace generated by a module extension, supports name remapping using keyword argument syntax. E.g. if the module extensionext
generates the external workspacefoo
then I can rename it tobar
using the syntaxThis limits the space of possible target names to those names which are valid Starlark identifiers. In particular, it is not possible to remap the workspace to the name
bar-baz
, because it is not a valid Starlark identifier, i.e. the following causes an errorHowever,
bar-baz
would be a legal name for an external workspace and@bar-baz//:xyz
would be a valid label. And other forms of repo name remapping do support the full range of possible workspace names, e.g. via thebazel_dep
repo_name
parameter which accepts a string. Making this limitation seem like an inconsistency.Please support repo name remapping to the full range of possible workspace names for module extension generated workspaces.
Which category does this issue belong to?
External Dependency
What underlying problem are you trying to solve with this feature?
I am trying to map old usage patterns under the WORKSPACE and repository rule system to bzlmod using isolated extensions and repo name remapping. See tweag/gazelle_cabal#61. In particular, I am trying to remap an external workspace generated by a module extension named
stackage-exe
to the namestackage-b-exe
.Which operating system are you running Bazel on?
Ubuntu 22.04
What is the output of
bazel info release
?release 6.2.0- (@non-git)
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.Nix
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
Bazel Slack discussion.
This kind of name remapping was possible using
kwargs
until 7a262a6, thanks @fmeum for the pointer.The text was updated successfully, but these errors were encountered: