admin管理员组

文章数量:1356709

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.

Share Improve this question edited Mar 31 at 8:36 Mark Rotteveel 110k229 gold badges156 silver badges223 bronze badges asked Mar 31 at 8:23 GuoGuo 4345 silver badges13 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Yes. 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. This features attribute is combined with the package level features attribute. For example, if the features ["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"],

本文标签: