Skip to content

Commit

Permalink
With patch found by user posted in grpc now we can refer to grpc as...
Browse files Browse the repository at this point in the history
  • Loading branch information
malkia committed Sep 9, 2024
1 parent 3b03299 commit ccff312
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
13 changes: 10 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "boringssl", version = "0.0.0-20240530-2db0eb3")
bazel_dep(name = "curl", version = "8.8.0.bcr.1")
bazel_dep(name = "depend_on_what_you_use", version = "0.4.0")
bazel_dep(name = "google_benchmark", version = "1.8.5")#, dev_dependency = True)
bazel_dep(name = "googletest", version = "1.15.2")#, dev_dependency = True)
bazel_dep(name = "grpc", version = "1.66.0.bcr.1", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "google_benchmark", version = "1.8.5") #, dev_dependency = True)
bazel_dep(name = "googletest", version = "1.15.2") #, dev_dependency = True)
bazel_dep(name = "grpc", version = "1.66.0.bcr.1") #, repo_name = "com_github_grpc_grpc")
single_version_override(
module_name = "grpc",
# https://github.com/grpc/grpc/pull/37534
# https://github.com/grpc/grpc/pull/37534.diff
patches = ["bazel/grpc_bzlmod.diff"],
patch_strip = 1,
)
bazel_dep(name = "nlohmann_json", version = "3.11.3")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.9")
Expand Down
21 changes: 21 additions & 0 deletions bazel/grpc_bzlmod.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/bazel/cc_grpc_library.bzl b/bazel/cc_grpc_library.bzl
index 55ea11cd53f07..8177bf864ceaf 100644
--- a/bazel/cc_grpc_library.bzl
+++ b/bazel/cc_grpc_library.bzl
@@ -102,7 +102,7 @@ def cc_grpc_library(
generate_cc(
name = codegen_grpc_target,
srcs = proto_targets,
- plugin = "@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin",
+ plugin = Label("//src/compiler:grpc_cpp_plugin"),
well_known_protos = well_known_protos,
generate_mocks = generate_mocks,
**kwargs
@@ -114,6 +114,6 @@ def cc_grpc_library(
hdrs = [":" + codegen_grpc_target],
deps = deps +
extra_deps +
- ["@com_github_grpc_grpc//:grpc++_codegen_proto"],
+ [Label("//:grpc++_codegen_proto")],
**kwargs
)
6 changes: 3 additions & 3 deletions examples/grpc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package(default_visibility = ["//visibility:public"])

load("@rules_proto//proto:defs.bzl", "proto_library")
load("@@grpc+//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("@grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("//:dll_deps.bzl", "dll_deps")
load("//bazel:otel_cc.bzl", "otel_cc_binary", "otel_cc_import", "otel_cc_library", "otel_cc_shared_library", "otel_cc_test")

Expand Down Expand Up @@ -54,7 +54,7 @@ otel_cc_binary(
":tracer_common",
"//api",
"//sdk/src/trace",
"@@grpc+//:grpc++",
"@grpc//:grpc++",
]),
)

Expand All @@ -69,6 +69,6 @@ otel_cc_binary(
":tracer_common",
"//api",
"//sdk/src/trace",
"@@grpc+//:grpc++",
"@grpc//:grpc++",
]),
)
8 changes: 4 additions & 4 deletions exporters/otlp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ otel_cc_library(
deps = [
"//ext:headers",
"//sdk/src/common:global_log_handler",
"@@grpc+//:grpc++",
"@grpc//:grpc++",
"@opentelemetry-proto//:common_proto_cc",
"@opentelemetry-proto//:logs_service_grpc_cc",
"@opentelemetry-proto//:metrics_service_grpc_cc",
Expand Down Expand Up @@ -543,7 +543,7 @@ otel_cc_test(
"@googletest//:gtest_main",
"@nlohmann_json//:json",
"@opentelemetry-proto//:trace_service_grpc_cc",
"@@grpc+//:grpc++",
"@grpc//:grpc++",
]),
)

Expand Down Expand Up @@ -642,7 +642,7 @@ otel_cc_test(
"@googletest//:gtest_main",
"@opentelemetry-proto//:logs_service_grpc_cc",
"@opentelemetry-proto//:trace_service_grpc_cc",
"@@grpc+//:grpc++",
"@grpc//:grpc++",
]),
)

Expand Down Expand Up @@ -769,7 +769,7 @@ otel_cc_benchmark(
deps = dll_deps([
":otlp_grpc_exporter",
"//examples/common/foo_library:common_foo_library",
"@@grpc+//:grpc++",
"@grpc//:grpc++",
"@opentelemetry-proto//:trace_service_grpc_cc",
]),
)
Expand Down

0 comments on commit ccff312

Please sign in to comment.