You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 master; 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?
I initially found the issue when using repository rule from a BzlMod module extension function, but could also reproduce it with simpler WORKSPACE directives.
For my project, I am currently working around the issue by using a hard-coded a relative path, which only works because we use a custom output_base that is in a parallel directory from the workspace one, but this is fragile, and not a general solution.
The text was updated successfully, but these errors were encountered:
It's available on HEAD, but the cherry-pick into 5.2.0 failed here and I don't think anybody has tried cherry-picking it into 5.3.0 again. You will probably have to wait for 6.0.0.
Description of the bug:
The documentation for
repository_ctx
states that it has aworkspace_root
field that returns apath
to the top-level workspace directory.When trying to use this inside an actual repository rule implementation, Bazel complains with an error that says:
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I have uploaded a minimal reproduction case here:
https://github.com/digit-google/bazel-experiments/tree/main/repository-rules/error-using-workspace_root
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?Bazel 5.3.0rc1
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
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
I initially found the issue when using repository rule from a BzlMod module extension function, but could also reproduce it with simpler WORKSPACE directives.
For my project, I am currently working around the issue by using a hard-coded a relative path, which only works because we use a custom output_base that is in a parallel directory from the workspace one, but this is fragile, and not a general solution.
The text was updated successfully, but these errors were encountered: