summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-04-05 10:56:49 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-04-10 16:07:46 +0200
commit086fc0e972f1552de7092a2031fe8af1b54fe4cc (patch)
treea09560e020d3fa21850c67c91744d58adad77ec3
parentce33e03626ccba3ddf24dbf3786649c2d5624157 (diff)
downloadjustbuild-086fc0e972f1552de7092a2031fe8af1b54fe4cc.tar.gz
grpc: hide dependency on google_rpc_status
grpc is used in the toolchain defaults for proto servive libraries. Still, it is typically built on its own, with its own toolchain, flags, etc. Now, grpc, however has a public dependency on a the rpc-status proto library, that the user may well use on their own, however building in their own way which can yield conflicts. To solve this, we hide the dependency on that proto library, as infrastructure libs should not make assumptions on user-servicable libraries. - First, we note that the dependency can be made a private one, which already solves the conflict on header files (which will essentially be the same, but might be defined in a different way). - Next, we note that the library at linking basically only acts as a default implementation; if the user provides their own version of the rpc-status library, we should prefer that anyway. As infrastructure is linked last, we have that default character anyway; the only thing to do is to rename the library that no staging conflict occurs. (cherry picked from commit dc97c25fabb53f95c4f0826db2323008e22505fd)
-rw-r--r--etc/import/TARGETS.google_apis2
-rw-r--r--etc/import/src/core/TARGETS.grpc12
2 files changed, 13 insertions, 1 deletions
diff --git a/etc/import/TARGETS.google_apis b/etc/import/TARGETS.google_apis
index 434dd21c..9a6a3e27 100644
--- a/etc/import/TARGETS.google_apis
+++ b/etc/import/TARGETS.google_apis
@@ -47,6 +47,8 @@
, "name": ["google_rpc_status_proto"]
, "srcs": ["google/rpc/status.proto"]
}
+, "google/rpc/status.proto":
+ {"type": "export", "target": ["FILE", null, "google/rpc/status.proto"]}
, "google_longrunning_operations_proto":
{ "type": ["@", "rules", "proto", "library"]
, "name": ["google_longrunning_operations_proto"]
diff --git a/etc/import/src/core/TARGETS.grpc b/etc/import/src/core/TARGETS.grpc
index 9d152959..0f5bb6a7 100644
--- a/etc/import/src/core/TARGETS.grpc
+++ b/etc/import/src/core/TARGETS.grpc
@@ -157,13 +157,22 @@
, "hdrs": ["lib/gprpp/construct_destruct.h"]
, "deps": [["", "gpr_platform"]]
}
+, "rpc_status_grpc_internal_default_proto":
+ { "type": ["@", "rules", "proto", "library"]
+ , "name": ["rpc_status_grpc_internal_default_proto"]
+ , "srcs": [["@", "google_apis", "", "google/rpc/status.proto"]]
+ }
+, "status_helper_private_proto_deps":
+ { "type": ["@", "rules", "CC", "library"]
+ , "name": ["status_helper_private_proto_deps"]
+ , "proto": ["rpc_status_grpc_internal_default_proto"]
+ }
, "status_helper":
{ "type": ["@", "rules", "CC", "library"]
, "name": ["status_helper"]
, "stage": ["src", "core"]
, "srcs": ["lib/gprpp/status_helper.cc"]
, "hdrs": ["lib/gprpp/status_helper.h"]
- , "proto": [["@", "google_apis", "", "google_rpc_status_proto"]]
, "deps":
[ "percent_encoding"
, "slice"
@@ -177,6 +186,7 @@
, ["third_party/upb", "upb"]
, ["src/core/ext/upb-generated", "upb-generated-lib"]
]
+ , "private-deps": ["status_helper_private_proto_deps"]
}
, "unique_type_name":
{ "type": ["@", "rules", "CC", "library"]