bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Bazel should have a way to exclude scanning certain directories when using //...

Open hhclam opened this issue 10 years ago • 1 comments

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.

hhclam avatar Jan 29 '16 22:01 hhclam

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

damienmg avatar Jan 31 '16 10:01 damienmg