bzlmod doesn't exclude bazel-* from ellipsis by default in submodules #24190
Labels
area-Bzlmod
Bzlmod-specific PRs, issues, and feature requests
help wanted
Someone outside the Bazel team could own this
P2
We'll consider working on this in future. (Assignee optional)
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
type: bug
Description of the bug:
If you run bazel build ... in a root module it will by default exclude the standard symlink dirs that get created by bazel (bazel-bin, bazel-out, etc.). If you cd into a submodule and do this it will create the symlink dirs and will work fine there, but if you go back to the root module and try to build everything in a submodule (bazel build @submodule//...) it will likely fail because it will go into the bazel-out dirs that were created by running directly in the submodule and find many broken build files. Errors like
Adding these bazel- dirs into .bazelignore in the submodule will cause it to behave as it does when bazel is called from under the directory of the submodule.
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.
Clone rules_python repo locally and cd into the directory in examples/bzlmod. Run this, should succeed
cd into other_module and open the MODULE.bazel and uncomment the local_path_override. Build the other module from this dir
cd back to the bzlmod dir and build @our_other_module//... again now, should error
you can create a .bazelignore in the submodule with the following and the error will go away
Which operating system are you running Bazel on?
Ubuntu 24.04
What is the output of
bazel info release
?release 7.3.1
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
If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
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: