summaryrefslogtreecommitdiff
path: root/CC/proto/RULES
diff options
context:
space:
mode:
Diffstat (limited to 'CC/proto/RULES')
-rw-r--r--CC/proto/RULES388
1 files changed, 0 insertions, 388 deletions
diff --git a/CC/proto/RULES b/CC/proto/RULES
deleted file mode 100644
index 910b6a1..0000000
--- a/CC/proto/RULES
+++ /dev/null
@@ -1,388 +0,0 @@
-{ "defaults":
- { "doc":
- [ "A rule to provide protoc/GRPC defaults."
- , "Used to implement [\"CC/proto\", \"defaults\"] for CC proto libraries"
- , "and [\"CC/proto\", \"service defaults\"] for CC proto service libraries"
- , "(GRPC)."
- ]
- , "target_fields": ["base", "toolchain", "deps"]
- , "string_fields":
- [ "PROTOC"
- , "PROTOCFLAGS"
- , "ADD_PROTOCFLAGS"
- , "LDFLAGS"
- , "ADD_LDFLAGS"
- , "GRPC_PLUGIN"
- , "PATH"
- ]
- , "config_vars": ["ARCH", "HOST_ARCH", "DEBUG"]
- , "field_doc":
- { "base":
- [ "Other targets (using the same rule) to inherit values from. If"
- , "multiple targets are specified, for values that are overwritten (see"
- , "documentation of other fields) the last specified value wins."
- ]
- , "toolchain":
- [ "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 extends artifacts from \"base\"."
- ]
- , "deps":
- [ "Optional CC libraries the resulting CC proto libraries implicitly"
- , "depend on. Those are typically \"libprotobuf\" for CC proto libraries"
- , "and \"libgrpc++\" for CC proto service libraries. Specifying this"
- , "field extends dependencies from \"base\"."
- ]
- , "PROTOC":
- [ "The proto compiler. If \"toolchain\" is empty, this field's value is"
- , "considered the proto compiler name that is looked up in \"PATH\". If"
- , "\"toolchain\" is non-empty, this field's value is assumed to be the"
- , "relative path to the proto compiler in \"toolchain\". Specifying this"
- , "field overwrites values from \"base\"."
- ]
- , "GRPC_PLUGIN":
- [ "The GRPC plugin for the proto compiler. If \"toolchain\" is empty,"
- , "this field's value is considered to be the absolute system path to the"
- , "plugin. If \"toolchain\" is non-empty, this field's value is assumed"
- , "to be the relative path to the plugin in \"toolchain\". Specifying"
- , "this field overwrites values from \"base\"."
- ]
- , "PROTOCFLAGS":
- [ "Protobuf compiler flags. Specifying this field overwrites values from"
- , "\"base\"."
- ]
- , "ADD_PROTOCFLAGS":
- [ "Additional protobuf compiler flags. Specifying this field extends"
- , "values from \"base\"."
- ]
- , "LDFLAGS":
- [ "Linker flags for linking the final CC library. Specifying this field"
- , "overwrites values from \"base\"."
- ]
- , "ADD_LDFLAGS":
- [ "Additional linker flags for linking the final CC library. Specifying"
- , "this field extends values from \"base\"."
- ]
- , "PATH":
- [ "Path for looking up the proto compiler. Individual paths are joined"
- , "with \":\". Specifying this field extends values from \"base\"."
- ]
- }
- , "config_doc":
- { "ARCH":
- [ "The unqualified architecture. Is taken as a default for \"HOST_ARCH\""
- , "and \"TARGET_ARCH\" if not set."
- ]
- , "HOST_ARCH":
- ["The architecture on which the build actions are carried out."]
- , "DEBUG":
- [ "If logically true (typically, a non-empty map), use debug-related"
- , "options, otherwise not."
- ]
- }
- , "imports":
- { "base-provides": ["./", "..", "defaults-base-provides"]
- , "base-provides-++": ["./", "..", "defaults-base-provides-++"]
- , "base-provides-list": ["./", "..", "defaults-base-provides-list"]
- , "artifacts_list": ["", "field_artifacts_list"]
- , "compile-deps": ["CC", "compile-deps"]
- , "compile-args-deps": ["CC", "compile-args-deps"]
- , "link-deps": ["CC", "link-deps"]
- , "link-args-deps": ["CC", "link-args-deps"]
- , "run-libs-deps": ["CC", "run-libs-deps"]
- , "run-libs-args-deps": ["CC", "run-libs-args-deps"]
- , "cflags-files-deps": ["CC", "cflags-files-deps"]
- , "ldflags-files-deps": ["CC", "ldflags-files-deps"]
- , "for host": ["transitions", "for host"]
- , "debug-deps": ["CC", "debug-deps"]
- }
- , "config_transitions":
- {"toolchain": [{"type": "CALL_EXPRESSION", "name": "for host"}]}
- , "expression":
- { "type": "let*"
- , "bindings":
- [ ["PROTOC", {"type": "FIELD", "name": "PROTOC"}]
- , ["PROTOCFLAGS", {"type": "FIELD", "name": "PROTOCFLAGS"}]
- , ["LDFLAGS", {"type": "FIELD", "name": "LDFLAGS"}]
- , ["GRPC_PLUGIN", {"type": "FIELD", "name": "GRPC_PLUGIN"}]
- , ["PATH", {"type": "FIELD", "name": "PATH"}]
- , ["provider", "PROTOC"]
- , [ "PROTOC"
- , { "type": "if"
- , "cond": {"type": "var", "name": "PROTOC"}
- , "then": {"type": "var", "name": "PROTOC"}
- , "else": {"type": "CALL_EXPRESSION", "name": "base-provides"}
- }
- ]
- , ["provider", "PROTOCFLAGS"]
- , [ "PROTOCFLAGS"
- , { "type": "if"
- , "cond": {"type": "var", "name": "PROTOCFLAGS"}
- , "then": {"type": "var", "name": "PROTOCFLAGS"}
- , "else": {"type": "CALL_EXPRESSION", "name": "base-provides-++"}
- }
- ]
- , ["provider", "LDFLAGS"]
- , [ "LDFLAGS"
- , { "type": "if"
- , "cond": {"type": "var", "name": "LDFLAGS"}
- , "then": {"type": "var", "name": "LDFLAGS"}
- , "else": {"type": "CALL_EXPRESSION", "name": "base-provides-++"}
- }
- ]
- , ["provider", "GRPC_PLUGIN"]
- , [ "GRPC_PLUGIN"
- , { "type": "if"
- , "cond": {"type": "var", "name": "GRPC_PLUGIN"}
- , "then": {"type": "var", "name": "GRPC_PLUGIN"}
- , "else": {"type": "CALL_EXPRESSION", "name": "base-provides"}
- }
- ]
- , ["provider", "PATH"]
- , [ "PATH"
- , { "type": "nub_left"
- , "$1":
- { "type": "++"
- , "$1":
- [ {"type": "var", "name": "PATH"}
- , {"type": "CALL_EXPRESSION", "name": "base-provides-++"}
- ]
- }
- }
- ]
- , ["provider", "ENV"]
- , ["default", {"type": "empty_map"}]
- , ["ENV", {"type": "CALL_EXPRESSION", "name": "base-provides"}]
- , ["provider", "NON_SYSTEM_TOOLS"]
- , ["default", {"type": "empty_map"}]
- , [ "NON_SYSTEM_TOOLS"
- , { "type": "map_union"
- , "$1":
- { "type": "++"
- , "$1":
- [ [{"type": "CALL_EXPRESSION", "name": "base-provides"}]
- , { "type": "if"
- , "cond": {"type": "FIELD", "name": "PROTOC"}
- , "then":
- [ { "type": "singleton_map"
- , "key": "PROTOC"
- , "value":
- { "type": "if"
- , "cond": {"type": "FIELD", "name": "toolchain"}
- , "then": true
- , "else": false
- }
- }
- ]
- }
- , { "type": "if"
- , "cond": {"type": "FIELD", "name": "GRPC_PLUGIN"}
- , "then":
- [ { "type": "singleton_map"
- , "key": "GRPC_PLUGIN"
- , "value":
- { "type": "if"
- , "cond": {"type": "FIELD", "name": "toolchain"}
- , "then": true
- , "else": false
- }
- }
- ]
- }
- ]
- }
- }
- ]
- , ["provider", "TOOLCHAIN"]
- , ["default", {"type": "empty_map"}]
- , [ "TOOLCHAIN"
- , { "type": "disjoint_map_union"
- , "msg": "toolchain artifacts may not overlap"
- , "$1":
- { "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_list"}
- }
- }
- ]
- }
- }
- ]
- , [ "PROTOCFLAGS"
- , { "type": "++"
- , "$1":
- [ {"type": "var", "name": "PROTOCFLAGS"}
- , {"type": "FIELD", "name": "ADD_PROTOCFLAGS"}
- ]
- }
- ]
- , [ "LDFLAGS"
- , { "type": "++"
- , "$1":
- [ {"type": "var", "name": "LDFLAGS"}
- , {"type": "FIELD", "name": "ADD_LDFLAGS"}
- ]
- }
- ]
- , ["deps-fieldnames", ["base", "deps"]]
- , ["compile-deps", {"type": "CALL_EXPRESSION", "name": "compile-deps"}]
- , [ "compile-args"
- , {"type": "CALL_EXPRESSION", "name": "compile-args-deps"}
- ]
- , ["link-deps", {"type": "CALL_EXPRESSION", "name": "link-deps"}]
- , ["link-args", {"type": "CALL_EXPRESSION", "name": "link-args-deps"}]
- , ["run-libs", {"type": "CALL_EXPRESSION", "name": "run-libs-deps"}]
- , [ "run-libs-args"
- , {"type": "CALL_EXPRESSION", "name": "run-libs-args-deps"}
- ]
- , [ "cflags-files"
- , {"type": "CALL_EXPRESSION", "name": "cflags-files-deps"}
- ]
- , [ "ldflags-files"
- , {"type": "CALL_EXPRESSION", "name": "ldflags-files-deps"}
- ]
- , ["package", {"type": "env", "vars": ["cflags-files", "ldflags-files"]}]
- , [ "debug-srcs"
- , { "type": "if"
- , "cond": {"type": "var", "name": "DEBUG"}
- , "then":
- { "type": "let*"
- , "bindings": [["deps-provider", "debug-srcs"]]
- , "body": {"type": "CALL_EXPRESSION", "name": "debug-deps"}
- }
- , "else": {"type": "empty_map"}
- }
- ]
- , [ "debug-hdrs"
- , { "type": "if"
- , "cond": {"type": "var", "name": "DEBUG"}
- , "then":
- { "type": "map_union"
- , "$1":
- [ { "type": "let*"
- , "bindings": [["deps-provider", "debug-hdrs"]]
- , "body": {"type": "CALL_EXPRESSION", "name": "debug-deps"}
- }
- , {"type": "var", "name": "compile-deps"}
- ]
- }
- , "else": {"type": "empty_map"}
- }
- ]
- ]
- , "body":
- { "type": "RESULT"
- , "provides":
- { "type": "env"
- , "vars":
- [ "PROTOC"
- , "PROTOCFLAGS"
- , "LDFLAGS"
- , "GRPC_PLUGIN"
- , "PATH"
- , "ENV"
- , "TOOLCHAIN"
- , "NON_SYSTEM_TOOLS"
- , "compile-deps"
- , "compile-args"
- , "link-deps"
- , "link-args"
- , "run-libs"
- , "run-libs-args"
- , "package"
- , "debug-srcs"
- , "debug-hdrs"
- ]
- }
- }
- }
- }
-, "library":
- { "doc":
- [ "A C++ library, generated from proto files."
- , ""
- , "This rule usually is used to bind anonymous targets generated from"
- , "proto libraries."
- ]
- , "string_fields": ["name", "stage"]
- , "target_fields": ["srcs", "deps"]
- , "config_vars": ["CXX", "CXXFLAGS", "ADD_CXXFLAGS", "AR", "ENV", "DEBUG"]
- , "implicit":
- {"defaults": [["./", "..", "defaults"]], "proto-defaults": ["defaults"]}
- , "imports": {"protoc-compile": "protoc-compile"}
- , "expression":
- { "type": "let*"
- , "bindings":
- [ ["name", {"type": "join", "$1": {"type": "FIELD", "name": "name"}}]
- , [ "DEBUG"
- , { "type": "if"
- , "cond": {"type": "var", "name": "DEBUG"}
- , "then": {"type": "var", "name": "DEBUG"}
- , "else": {"type": "empty_map"}
- }
- ]
- , [ "stage"
- , { "type": "join"
- , "separator": "/"
- , "$1": {"type": "FIELD", "name": "stage"}
- }
- ]
- , ["public-fieldnames", ["deps", "proto-defaults", "defaults"]]
- , ["private-fieldnames", ["deps", "proto-defaults", "defaults"]]
- ]
- , "body": {"type": "CALL_EXPRESSION", "name": "protoc-compile"}
- }
- }
-, "service library":
- { "doc":
- [ "A service C++ library, generated from proto files."
- , ""
- , "Calls protoc with gRPC plugin to additionally generate gRPC services"
- , "from proto libraries."
- ]
- , "string_fields": ["name", "stage"]
- , "target_fields": ["srcs", "deps"]
- , "config_vars": ["CXX", "CXXFLAGS", "ADD_CXXFLAGS", "AR", "ENV", "DEBUG"]
- , "implicit":
- { "defaults": [["./", "..", "defaults"]]
- , "proto-defaults": ["service defaults"]
- }
- , "imports": {"protoc-compile": "protoc-compile"}
- , "expression":
- { "type": "let*"
- , "bindings":
- [ ["service support", true]
- , ["name", {"type": "join", "$1": {"type": "FIELD", "name": "name"}}]
- , [ "DEBUG"
- , { "type": "if"
- , "cond": {"type": "var", "name": "DEBUG"}
- , "then": {"type": "var", "name": "DEBUG"}
- , "else": {"type": "empty_map"}
- }
- ]
- , [ "stage"
- , { "type": "join"
- , "separator": "/"
- , "$1": {"type": "FIELD", "name": "stage"}
- }
- ]
- , ["public-fieldnames", ["deps", "proto-defaults", "defaults"]]
- , ["private-fieldnames", ["deps", "proto-defaults", "defaults"]]
- ]
- , "body": {"type": "CALL_EXPRESSION", "name": "protoc-compile"}
- }
- }
-}