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
diff --git a/third_party/com/github/bazelbuild/bazel/src/main/protobuf/crosstool_config.proto b/third_party/com/github/bazelbuild/bazel/src/main/protobuf/crosstool_config.proto
index e7c3600..0a59e2d 100644
--- a/third_party/com/github/bazelbuild/bazel/src/main/protobuf/crosstool_config.proto
+++ b/third_party/com/github/bazelbuild/bazel/src/main/protobuf/crosstool_config.proto
@@ -127,11 +127,19 @@
   }
 
   // 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 @@
     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 @@
     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 @@
     // 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.