-
Notifications
You must be signed in to change notification settings - Fork 4k
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
alias() doesn't support surfacing a *_flag to the command line #20582
Comments
I initially confused this with #13463, which was aliasing on the config_setting instead of the bool_flag. |
Can https://bazel.build/reference/command-line-reference#flag--flag_alias work for you? I thought we had some support for what you describe, but I guess not? |
Our build targets are, generated from a repository rule which inspects local build manifests (which we are slowly migrating away from). As the targets are dynamic, we cannot use a static bazelrc with --flag_alias for that. I think if we write a bazelrc file to be imported by the main file, in the tools/bazel wrapper, then we can get dynamically generated aliases. It might be hard to pull off though. The build manifest analysis is expensive and lives inside a Bazel invocation already. |
Fixes bazelbuild#20582 RELNOTES: Starlark command-line flags can now be referred to through `alias` targets. Closes bazelbuild#22192. PiperOrigin-RevId: 629865954 Change-Id: I6215c8484ddc08e75507191bfa1eb5bc709c5fc6
Fixes #20582 RELNOTES: Starlark command-line flags can now be referred to through `alias` targets. Closes #22192. PiperOrigin-RevId: 629865954 Change-Id: I6215c8484ddc08e75507191bfa1eb5bc709c5fc6 Commit 43fdcd3 Co-authored-by: Fabian Meumertzheim <[email protected]>
Fixes bazelbuild#20582 RELNOTES: Starlark command-line flags can now be referred to through `alias` targets. Closes bazelbuild#22192. PiperOrigin-RevId: 629865954 Change-Id: I6215c8484ddc08e75507191bfa1eb5bc709c5fc6
A fix for this issue has been included in Bazel 7.2.0 RC1. Please test out the release candidate and report any issues as soon as possible. |
Description of the feature request:
Which category does this issue belong to?
Configurability
What underlying problem are you trying to solve with this feature?
We were trying to expose user-friendly flags aliases to generated repositories, so users don't have to type the full path of packages.
E.g. people can use
--@portage//target/sys-apps/attr:2.5.1_incremental
instead of--@portage//internal/packages/stage2/target/board/portage-stable/sys-apps/attr:2.5.1_incremental
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?development version
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
For our use case, we also need the
alias
'sactual
to be in aselect
.e.g. something like
alias(name = "incremental", actual = select({"//bazel/stage1": "//internal/stage1/pkg/incremental", "//bazel/stage2": "//internal/stage2/pkg/incremental"})
Not sure if it is something possible to support.
The text was updated successfully, but these errors were encountered: