bazel
bazel copied to clipboard
Bazel should have a way to exclude scanning certain directories when using //...
When using the //... label to refer to all targets in the workspace Bazel always scan into all directories even if exclusion is used, e.g. using the - operator. The exclusion only happens after Bazel has scanned through the directories.
It would be nice if Bazel has options to exclude directories such as --exclude_dir=something/ that we can instruct not do scan.
Sorry this actually exists: --deleted_packages it the option your are looking for:
$ ../bazel/output/bazel --bazelrc=/dev/null query ...
Sending SIGTERM to previous Bazel server (pid=3360)... done.
............
ERROR: /private/tmp/test/test/BUILD:1:1: name 'bleh' is not defined.
ERROR: package contains errors: test.
ERROR: no such package 'test': Package 'test' contains errors.
$ ../bazel/output/bazel --bazelrc=/dev/null query --deleted_packages=test ...
//:test
$ cat test/BUILD
bleh