aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/protobuf
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-11-21 08:21:49 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-11-21 08:24:09 -0800
commitedc3901ecaafdb778a8e9fac463af1b2812f8f48 (patch)
tree8934ad64d577d532ca96fec06fc0c52bddee874b /src/main/protobuf
parent03d52e23ef2e247ebd17bc10ed122795e7113472 (diff)
Allow conditioning flags on the _absence_ of a feature.
This allows a flag_set to emit one flag when a feature is enabled, and a different flag when that feature is disabled. And while I was in there, I noticed and fixed a couple other issues: 1. env_set didn't actually implement with_feature, despite having the field in its proto. 2. action_config implemented with_feature as an optional field, instead of repeated field. RELNOTES: None PiperOrigin-RevId: 176510960
Diffstat (limited to 'src/main/protobuf')
-rw-r--r--src/main/protobuf/crosstool_config.proto34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/main/protobuf/crosstool_config.proto b/src/main/protobuf/crosstool_config.proto
index 3ef9ad01c1..d0ae71a584 100644
--- a/src/main/protobuf/crosstool_config.proto
+++ b/src/main/protobuf/crosstool_config.proto
@@ -127,11 +127,19 @@ message CToolchain {
}
// A set of features; used to support logical 'and' when specifying feature
- // requirements in FlagSet and Feature.
+ // requirements in Feature.
message FeatureSet {
repeated string feature = 1;
}
+ // A set of positive and negative features. This stanza will
+ // evaluate to true when every 'feature' is enabled, and every
+ // 'not_feature' is not enabled.
+ message WithFeatureSet {
+ repeated string feature = 1;
+ repeated string not_feature = 2;
+ }
+
// A set of flags that are expanded in the command line for specific actions.
message FlagSet {
// The actions this flag set applies to; each flag set must specify at
@@ -142,12 +150,13 @@ message CToolchain {
repeated FlagGroup flag_group = 2;
// A list of feature sets defining when this flag set gets applied. The
- // flag set will be applied when any of the feature sets fully apply, that
- // is, when all features of the feature set are enabled.
+ // flag set will be applied when any one of the feature sets evaluate to
+ // true. (That is, when when every 'feature' is enabled, and every
+ // 'not_feature' is not enabled.)
//
// If 'with_feature' is omitted, the flag set will be applied
// unconditionally for every action specified.
- repeated FeatureSet with_feature = 3;
+ repeated WithFeatureSet with_feature = 3;
// A list of build variables that this feature set needs, but which are
// allowed to not be set. If any of the build variables listed is not
@@ -171,12 +180,13 @@ message CToolchain {
repeated EnvEntry env_entry = 2;
// A list of feature sets defining when this env set gets applied. The
- // env set will be applied when any of the feature sets fully apply, that
- // is, when all features of the feature set are enabled.
+ // env set will be applied when any one of the feature sets evaluate to
+ // true. (That is, when when every 'feature' is enabled, and every
+ // 'not_feature' is not enabled.)
//
// If 'with_feature' is omitted, the env set will be applied
// unconditionally for every action specified.
- repeated FeatureSet with_feature = 3;
+ repeated WithFeatureSet with_feature = 3;
}
// Contains all flag specifications for one feature.
@@ -235,10 +245,14 @@ message CToolchain {
// Path to the tool, relative to the location of the crosstool.
required string tool_path = 1;
- // A feature set defining when this tool is applicable. If this attribute
- // is left out, the Tool will be assumed to apply for any feature
+ // A list of feature sets defining when this tool is applicable. The tool
+ // will used when any one of the feature sets evaluate to true. (That is,
+ // when when every 'feature' is enabled, and every 'not_feature' is not
+ // enabled.)
+ //
+ // If 'with_feature' is omitted, the tool will apply for any feature
// configuration.
- optional FeatureSet with_feature = 2;
+ repeated WithFeatureSet with_feature = 2;
// Requirements on the execution environment for the execution of this tool,
// to be passed as out-of-band "hints" to the execution backend.