diff options
Diffstat (limited to 'CC/proto/RULES')
-rw-r--r-- | CC/proto/RULES | 74 |
1 files changed, 42 insertions, 32 deletions
diff --git a/CC/proto/RULES b/CC/proto/RULES index ac7a371..8108161 100644 --- a/CC/proto/RULES +++ b/CC/proto/RULES @@ -19,7 +19,7 @@ [ "Optional toolchain directory. A collection of artifacts that provide" , "the protobuf compiler and the GRPC plugin (if needed). Note that only" , "artifacts of the specified targets are considered (no runfiles etc.)." - , "Specifying this field overlays artifacts from \"base\"." + , "Specifying this field extends artifacts from \"base\"." ] , "deps": [ "Optional CC libraries the resulting CC proto libraries implicitly" @@ -51,12 +51,14 @@ ] , "PATH": [ "Path for looking up the proto compiler. Individual paths are joined" - , "with \":\"." + , "with \":\". Specifying this field extends values from \"base\"." ] } , "imports": { "base-provides": ["./", "..", "defaults-base-provides"] - , "artifacts": ["", "field_artifacts"] + , "base-provides-list": ["./", "..", "defaults-base-provides-list"] + , "artifacts_list": ["", "field_artifacts_list"] + , "nub_left": ["", "nub_left"] , "compile-deps": ["CC", "compile-deps"] , "compile-args-deps": ["CC", "compile-args-deps"] , "link-deps": ["CC", "link-deps"] @@ -100,23 +102,26 @@ , "else": {"type": "CALL_EXPRESSION", "name": "base-provides"} } ] - , ["provider", "ENV"] - , ["default", {"type": "empty_map"}] - , [ "ENV" - , { "type": "if" - , "cond": {"type": "var", "name": "PATH"} - , "then": - { "type": "singleton_map" - , "key": "PATH" - , "value": - { "type": "join" - , "separator": ":" - , "$1": {"type": "var", "name": "PATH"} + , ["provider", "PATH"] + , [ "PATH" + , { "type": "++" + , "$1": + [ {"type": "var", "name": "PATH"} + , { "type": "++" + , "$1": {"type": "CALL_EXPRESSION", "name": "base-provides-list"} } - } - , "else": {"type": "CALL_EXPRESSION", "name": "base-provides"} + ] } ] + , [ "PATH" + , { "type": "let*" + , "bindings": [["list", {"type": "var", "name": "PATH"}]] + , "body": {"type": "CALL_EXPRESSION", "name": "nub_left"} + } + ] + , ["provider", "ENV"] + , ["default", {"type": "empty_map"}] + , ["ENV", {"type": "CALL_EXPRESSION", "name": "base-provides"}] , ["provider", "NON_SYSTEM_TOOLS"] , ["default", {"type": "empty_map"}] , [ "NON_SYSTEM_TOOLS" @@ -160,24 +165,28 @@ , ["provider", "TOOLCHAIN"] , ["default", {"type": "empty_map"}] , [ "TOOLCHAIN" - , { "type": "map_union" + , { "type": "disjoint_map_union" + , "msg": "toolchain artifacts may not overlap" , "$1": - [ {"type": "CALL_EXPRESSION", "name": "base-provides"} - , { "type": "if" - , "cond": {"type": "FIELD", "name": "toolchain"} - , "then": - { "type": "let*" - , "bindings": - [ ["fieldname", "toolchain"] - , [ "transition" - , {"type": "CALL_EXPRESSION", "name": "for host"} + { "type": "++" + , "$1": + [ {"type": "CALL_EXPRESSION", "name": "base-provides-list"} + , { "type": "if" + , "cond": {"type": "FIELD", "name": "toolchain"} + , "then": + { "type": "let*" + , "bindings": + [ ["fieldname", "toolchain"] + , [ "transition" + , {"type": "CALL_EXPRESSION", "name": "for host"} + ] ] - ] - , "body": {"type": "CALL_EXPRESSION", "name": "artifacts"} + , "body": + {"type": "CALL_EXPRESSION", "name": "artifacts_list"} + } } - , "else": {"type": "empty_map"} - } - ] + ] + } } ] , [ "LDFLAGS" @@ -215,6 +224,7 @@ [ "PROTOC" , "LDFLAGS" , "GRPC_PLUGIN" + , "PATH" , "ENV" , "TOOLCHAIN" , "NON_SYSTEM_TOOLS" |