module extension not re-evaluated when env variable is modified #22404
Labels
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
type: bug
untriaged
Description of the bug:
TL;DR: Extension modules that use ctx.getenv are not re-evaluated when the env variable is modified.
Repro.
I have a simple MODULE file:
and the extension ext.bzl:
Steps:
MYVAR=abc bazel build ...
)I've noticed that repository rules are re-evaluated if I use
ctx.getenv
, but module extensions are not. Is it working as intended?To me, this seems error-prone and can lead to correctness issues. I fail to see how
ctx.getenv
can be used in a safe way.Which category does this issue belong to?
External Dependency
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
No response
Which operating system are you running Bazel on?
MacOS
What is the output of
bazel info release
?release 7.1.0
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
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: