Skip to content

Commit

Permalink
Use Label() instead of specifying the repo name
Browse files Browse the repository at this point in the history
This allows dependents to use another repo name
and allows to avoid specifying transitive dependencies with Bzlmod.
  • Loading branch information
mering committed Dec 13, 2024
1 parent 0498194 commit 692a139
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bazel/cc_grpc_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
)
4 changes: 2 additions & 2 deletions bazel/generate_objc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ generate_objc = rule(
providers = [ProtoInfo],
),
"plugin": attr.label(
default = "@com_github_grpc_grpc//src/compiler:grpc_objective_c_plugin",
default = Label("//src/compiler:grpc_objective_c_plugin"),
executable = True,
providers = ["files_to_run"],
cfg = "exec",
Expand All @@ -177,7 +177,7 @@ generate_objc = rule(
default = False,
),
"well_known_protos": attr.label(
default = "@com_google_protobuf//:well_known_type_protos",
default = Label("@com_google_protobuf//:well_known_type_protos"),
),
"_protoc": attr.label(
default = Label("@com_google_protobuf//:protoc"),
Expand Down
4 changes: 2 additions & 2 deletions bazel/objc_grpc_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def objc_grpc_library(name, deps, srcs = [], use_well_known_protos = False, **kw
"src/objective-c",
],
deps = [
"@com_github_grpc_grpc//src/objective-c:proto_objc_rpc",
"@com_google_protobuf//:protobuf_objc",
Label("//src/objective-c:proto_objc_rpc"),
Label("@com_google_protobuf//:protobuf_objc"),
],
**kwargs
)

0 comments on commit 692a139

Please sign in to comment.