Skip to content

Commit a94e9d2

Browse files
committed
Add some of 'buildtools/' subfolders to the '.bazelignore' file.
Some of the deps used for the GN build (installed via 'tools/install-build-deps') pulls Bazel build files that are placed into `buildtools/` subfolders, e.g.: `buildtools/benchmark`. If we later use `bazel query` to check the structure of our Blaze build, these files are considered part of our Blaze project, leading to obscure errors about missing `@@py_deps//` We want to exclude all the dirs that contains a BUILD or BUILD.bazel file, because Bazel considers such dirs as part of the project, EXEPT for the 'buildtools/expat' dir, that is a part of the build and should be kept. The following command is used to generate the list: `find buildtools -regex ".*/BUILD\(\.bazel\)?" | xargs -I {} sh -c 'echo "{}" | awk "{ print \$1, \$2 }" FS=/ OFS=/' | uniq | grep -v expat` Tested: bazel query //... bazel build :all Bug: N/A. Change-Id: I6db32ec022c5fcc35afc5e63a5b3a24afc1c5b7f
1 parent 059fa4f commit a94e9d2

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.bazelignore

+17-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1-
ui
1+
ui
2+
3+
# Blaze 8 has an API to specify a glob of dirs to ignore:
4+
# https://bazel.build/versions/8.0.0/rules/lib/globals/repo#ignore_directories.
5+
# But we are using Blaze 7 and so explicitly lists the directories.
6+
#
7+
# We want to exclude all the dirs that contains a BUILD or BUILD.bazel file,
8+
# because Bazel considers such dirs as part of the project, EXEPT for the
9+
# 'buildtools/expat' dir, that is a part of the build and should be kept.
10+
# The following command is used to generate the list:
11+
# $ find buildtools -regex ".*/BUILD\(\.bazel\)?" | \
12+
# xargs -I {} sh -c 'echo "{}" | awk "{ print \$1, \$2 }" FS=/ OFS=/' | \
13+
# uniq | grep -v expat
14+
buildtools/googletest
15+
buildtools/protobuf
16+
buildtools/ndk
17+
buildtools/benchmark

0 commit comments

Comments
 (0)