-
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
bzlmod: “bazel mod” should fail if bzlmod is disabled #21303
Comments
aa60e35 may not provide a full solution to what @sluongng described:
I just learned that |
@fmeum However, it does not show the actual value when it's the default value. And between Bazel 6 and Bazel 7, the default value is flipped. So a more reliable way is something like this
and then switch the behavior depending on the parsed release version. |
Small note: I would appreciate it if the fix commit(s) were cherry-picked back to Bazel 7. When I view it on Github, it seems to be a Bazel-8-only fix. |
@bazel-io flag |
@bazel-io fork 7.2.0 |
Maybe? Note that change only affects the cc @brandjon |
I tried to cherry-pick this to release-7.2.0, but looks like the changes are already included with 7.1.0. So we don't need to cherry-pick this to release-7.2.0. See 08cc45b |
bazel mod show_repo returns a successful exit code even if you add build --enable_bzlmod=false to .bazelrc on older Bazel versions, see bazelbuild/bazel#21303
Description of the feature request:
It would be nice to have
bazel mod
failing with a fixed exit code whencommon —-noenable_bzlmod
is set in.bazelrc
. Right now,bazel mod
always succeed.Which category does this issue belong to?
External Dependency
What underlying problem are you trying to solve with this feature?
Standalone tools (tools that are not managed or distributed in-repo by Bazel) have a need to detect whether a repository is using bzlmod or not.
Let’s say we have an internal tool that’s get distributed with
go install .../abc-cli@latest
. Theabc
cli needs to know whether the current repo is using bzlmod programmatically to change it’s behavior accordingly.Which operating system are you running Bazel on?
MacOS
What is the output of
bazel info release
?7.0.2
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; 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?
Discussed in https://bazelbuild.slack.com/archives/C014RARENH0/p1707680524793959
The text was updated successfully, but these errors were encountered: