Skip to content

bzlmod: “bazel mod” should fail if bzlmod is disabled #21303

@sluongng

Description

@sluongng

Description of the feature request:

It would be nice to have bazel mod failing with a fixed exit code when common —-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. The abc 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 returns development 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

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)help wantedSomeone outside the Bazel team could own thisteam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: feature request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions