This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update protobuf rules; upgrade to rules_go 0.16.1 (#203)
Previous protobuf rules used by example gRPC server/client implementations did not use proto_library. This change updates to these rules (compatible with newer rules_go) Upgrade to rules_go 0.16.1. Previously, the e2e_test.sh assumed the name of the generated go_binary matched the rule name, but with changes introduced for cross-compilation, that assumption no longer held true. A genrule has been introduced to fix that.
- Loading branch information
Showing
13 changed files
with
118 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
load("@io_bazel_rules_go//go:def.bzl", "go_binary") | ||
load("@org_pubref_rules_protobuf//go:rules.bzl", "GRPC_COMPILE_DEPS") | ||
|
||
go_binary( | ||
name = "client", | ||
name = "client_bin", | ||
srcs = ["main.go"], | ||
importpath = "github.com/bazelbuild/rules_k8s/rules_k8s/examples/hellogrpc/go/client", | ||
deps = [ | ||
"//examples/hellogrpc/proto:go", | ||
] + GRPC_COMPILE_DEPS, | ||
"//examples/hellogrpc/proto:simple_go_grpc", | ||
"@org_golang_google_grpc//:go_default_library", | ||
], | ||
) | ||
|
||
# Normalize the binary name per | ||
# https://github.com/bazelbuild/rules_go/issues/1239#issuecomment-361296415 | ||
genrule( | ||
name = "client_exe", | ||
srcs = [":client_bin"], | ||
outs = ["client"], | ||
cmd = "cp $(SRCS) $@", | ||
output_to_bindir = True, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
proto_library( | ||
name = "simple_proto", | ||
srcs = ["simple.proto"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
load("@org_pubref_rules_protobuf//cpp:rules.bzl", "cc_proto_library") | ||
load("@build_stack_rules_proto//cpp:cpp_grpc_library.bzl", "cpp_grpc_library") | ||
|
||
cc_proto_library( | ||
name = "cc", | ||
protos = [ | ||
"simple.proto", | ||
], | ||
cpp_grpc_library( | ||
name = "simple_cc_grpc", | ||
deps = [":simple_proto"], | ||
visibility = ["//examples/hellogrpc/cc:__subpackages__"], | ||
) | ||
|
||
load("@org_pubref_rules_protobuf//java:rules.bzl", "java_proto_library") | ||
load("@build_stack_rules_proto//java:java_grpc_library.bzl", "java_grpc_library") | ||
|
||
java_proto_library( | ||
name = "java", | ||
protos = [ | ||
"simple.proto", | ||
], | ||
java_grpc_library( | ||
name = "simple_java_grpc", | ||
deps = [":simple_proto"], | ||
visibility = ["//examples/hellogrpc/java:__subpackages__"], | ||
) | ||
|
||
load("@org_pubref_rules_protobuf//go:rules.bzl", "go_proto_library") | ||
load("@build_stack_rules_proto//go:go_grpc_library.bzl", "go_grpc_library") | ||
|
||
go_proto_library( | ||
name = "go", | ||
go_grpc_library( | ||
name = "simple_go_grpc", | ||
importpath = "github.com/bazelbuild/rules_k8s/examples/hellogrpc/proto/go", | ||
protos = [ | ||
"simple.proto", | ||
], | ||
deps = [":simple_proto"], | ||
visibility = ["//examples/hellogrpc/go:__subpackages__"], | ||
) | ||
|
||
load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") | ||
load("@build_stack_rules_proto//python:python_grpc_library.bzl", "python_grpc_library") | ||
|
||
py_proto_library( | ||
name = "py", | ||
protos = [ | ||
"simple.proto", | ||
], | ||
python_grpc_library( | ||
name = "simple_python_grpc", | ||
deps = [":simple_proto"], | ||
visibility = ["//examples/hellogrpc/py:__subpackages__"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
grpcio==1.6.0 | ||
setuptools==39.2.0 | ||
setuptools==39.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters