bazelbuild / bazelbuild/bazel

bzlmod mod commands don't support flags that affect repo generation

Open
#24,070 1 comment 0 reactions 1 assignee Claimed by @Wyverald View on GitHub
area-Bzlmod P2 team-ExternalDeps type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

When `--action_env` is used to set environment variables to affect what repos are generated, `bazel mod` commands will fail.

Stated more specifically: in rules_python, in a bazel-in-bazel integration test, we pass `--action_env=RULES_PYTHON_REPO_DEBUG=1`. When this env var is set, it causes our bzlmod extension to generate an extra repo with debugging information in it. If not set, then the repo isn't generated. Unfortunately, the `bazel mod` command doesn't support `--action_env`. The net effect is `use_repo()` in the MODULE file references a repo that doesn't exist, and the mod command fails entirely.

### Which category does this issue belong to?

_No response_

### What underlying problem are you trying to solve with this feature?

To make it easy to have the same looking invocation between commands. Similarly, flags that could affect the module phase should also be supported by the mod command (similar to query vs cquery)

### Which operating system are you running Bazel on?

Linux

### What is the output of `bazel info release`?

7.3.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?

A quick search of github didn't show anything

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.