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
{{ message }}
Repository navigation
bazel query doesn't work correctly with external repositories. #10234
Currently, Bazel doesn't support .bazelignore for external repository, but .bazelignore still affects the behavior of bazel query on external repositories.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
mkdir -p other_repo/foo/bar
touch other_repo/WORKSPACE
touch other_repo/foo/bar/file.txt
cat >> other_repo/foo/bar/BUILD <<EOF
filegroup(
name = "file",
srcs = ["file.txt"],
)
EOF
mkdir my_repo
cat >> my_repo/WORKSPACE <<EOF
local_repository(
name = "other_repo",
path = "../other_repo",
)
EOF
cat >> my_repo/.bazelignore <<EOF
foo/bar
EOF
cd my_repo
bazel query @other_repo//foo/bar/...
Starting local Bazel server and connecting to it...
ERROR: no targets found beneath 'foo/bar'
Loading: 0 packages loaded
rm .bazelignore
bazel query @other_repo//foo/bar/...
@other_repo//foo/bar:file
.bazelignore should only affects packages in main repo, not the packages with the same path in external repo.
What's the output of bazel info release?
1.1.0
Solution
We plan to add support of .bazelignore file for external repo in #9080, this bug should be fixed by reading the .bazelignore file from the correct places based on where the packages come from. For example, when query @other_repo//foo/bar/... we should use .bazelignore file from @other_repo instead of the one from the main repo.
Activity
Support .bazelignore file for external repo