Introduce structured build variables in Crosstool
This cl adds a 3rd type of build variable - structs. Structs have fields, which
can hold any build variable type (including structs). In the CROSSTOOl, the
fields are accessed by the dot-notation, e.g.:
flag_group {
iterate_over: "libraries_to_link
flag_group {
iterate_over: "libraries_to_link.libraries"
flag: "-L%{libraries_to_link.libraries.directory}"
}
}
As a memory optimization, we also add StructureSequences. These save us from
the overhead of individual StructureValue objects.
RELNOTES: NONE
PiperOrigin-RevId: 138851774
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 3d7f891..158b7a6 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
@@ -65,6 +65,15 @@
// ... will get expanded to -I /to/path1 -I /to/path2 ... for each
// include_path /to/pathN.
//
+ // To expand a variable of structure type, use dot-notation, e.g.:
+ // flag_group {
+ // iterate_over: "libraries_to_link"
+ // flag_group {
+ // iterate_over: "libraries_to_link.libraries"
+ // flag: "-L%{libraries_to_link.libraries.directory}"
+ // }
+ // }
+ //
// Flag groups can be nested; if they are, the flag group must only contain
// other flag groups (no flags) so the order is unambiguously specified.
// In order to expand a variable of nested lists, 'iterate_over' can be used.