Error calling attr
for generated repository_rule
inside macro called by WORKSPACE
#20463
Labels
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
type: bug
untriaged
Description of the bug:
An in-house
env_vars
macro creates a_env_vars
repository rule. This is done soenviron
can be set, so the repository is regenerated should any listed environment variable change.In Bazel 7 (tested on
7.0.0-pre.20231011.2
,7.0.0rc6
and7.0.0rc7
) this leads to the following error.As a workaround (and realistically, an optimisation) attribute declaration was moved out of the macro.
e.g.
Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Setup:
Reproducing:
Which operating system are you running Bazel on?
macOS Sonoma
What is the output of
bazel info release
?release 7.0.0rc7
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 master; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
Maybe. There has been a lot of work in this area for bzlmod and I understand some compatibility breaks are intentional. This could be one such instance.
Given the error message implies this use case is supported, I'm inclined to believe this is a regression.
Note that this issue is not present in Bazel 6.3.2.
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
Potentially related, this is pulled from the draft Bazel 7 release announcement.
The text was updated successfully, but these errors were encountered: