I'm working on a project that has a CI pipeline the builds and runs tests automatically. The CI scripts are not likely to change. The tests are built in CI with the following flags: --feature=ABC
Due to some requirements, I need to disable this feature in one of the Bazel target (cc_test
). Because it'll affect too many areas if I change the CI scripts, I wonder if it is possible to just remove this --feature=ABC
from this single Bazel target.
I'm working on a project that has a CI pipeline the builds and runs tests automatically. The CI scripts are not likely to change. The tests are built in CI with the following flags: --feature=ABC
Due to some requirements, I need to disable this feature in one of the Bazel target (cc_test
). Because it'll affect too many areas if I change the CI scripts, I wonder if it is possible to just remove this --feature=ABC
from this single Bazel target.
1 Answer
Reset to default 0Yes. As described in the docs:
features
List of feature strings; default is [] A feature is string tag that can be enabled or disabled on a target. The meaning of a feature depends on the rule itself. Thisfeatures
attribute is combined with the package levelfeatures
attribute. For example, if thefeatures
["a", "b"] are enabled on the package level, and a target's features attribute contains ["-a", "c"], the features enabled for the rule will be "b" and "c". See example.
Or in short, in your case, for relevant cc_*
targets add to make sure feature "ABC" is disabled for that target.
features = ["-ABC"],