From c76a139e30d5e2530cdac64d324fdad692be8607 Mon Sep 17 00:00:00 2001 From: Marcus Hines Date: Fri, 3 Nov 2023 20:32:28 +0000 Subject: [PATCH] Update grpc bazel library and rerun gazelle --- BUILD.bazel | 2 ++ WORKSPACE | 10 +++++----- bgp/BUILD.bazel | 8 +++++++- cert/BUILD.bazel | 8 +++++++- common/BUILD.bazel | 10 ++++++++-- containerz/BUILD.bazel | 16 +++++++++++----- debug/BUILD.bazel | 8 +++++++- diag/BUILD.bazel | 10 ++++++++-- factory_reset/BUILD.bazel | 8 +++++++- file/BUILD.bazel | 4 ++-- healthz/BUILD.bazel | 3 ++- layer2/BUILD.bazel | 8 +++++++- mpls/BUILD.bazel | 8 +++++++- os/BUILD.bazel | 8 +++++++- otdr/BUILD.bazel | 8 +++++++- packet_capture/BUILD.bazel | 24 ++++++++++++++++++++++++ packet_link_qualification/BUILD.bazel | 9 ++++++++- system/BUILD.bazel | 10 ++++++++-- test/BUILD.bazel | 8 ++++---- wavelength_router/BUILD.bazel | 8 +++++++- 20 files changed, 145 insertions(+), 33 deletions(-) create mode 100644 packet_capture/BUILD.bazel diff --git a/BUILD.bazel b/BUILD.bazel index 577aeaf8..805bd137 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -24,3 +24,5 @@ exports_files(["LICENSE"]) # gazelle:prefix github.com/openconfig/gnoi gazelle(name = "gazelle") + +# gazelle:exclude **.pb.go diff --git a/WORKSPACE b/WORKSPACE index 9dae2397..89ee4cdf 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -3,9 +3,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") ### Bazel rules for many languages to compile PROTO into gRPC libraries http_archive( name = "rules_proto_grpc", - sha256 = "bbe4db93499f5c9414926e46f9e35016999a4e9f6e3522482d3760dc61011070", - strip_prefix = "rules_proto_grpc-4.2.0", - urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/archive/4.2.0.tar.gz"], + sha256 = "f87d885ebfd6a1bdf02b4c4ba5bf6fb333f90d54561e4d520a8413c8d1fb7beb", + strip_prefix = "rules_proto_grpc-4.5.0", + urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/archive/4.5.0.tar.gz"], ) load( @@ -33,7 +33,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe go_rules_dependencies() -go_register_toolchains(go_version = "1.18") +go_register_toolchains(go_version = "1.20") # gazelle:repo bazel_gazelle bazel_gazelle() @@ -110,4 +110,4 @@ http_archive( urls = [ "https://github.com/YangModels/yang/archive/2fa291d6bdb4b281d4e1b3dfa3254ffa7257d800.zip", ], -) \ No newline at end of file +) diff --git a/bgp/BUILD.bazel b/bgp/BUILD.bazel index 25118f8a..18456c66 100644 --- a/bgp/BUILD.bazel +++ b/bgp/BUILD.bazel @@ -51,5 +51,11 @@ go_proto_library( compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnoi/bgp", proto = ":bgp_proto", - deps = ["//types:types_go_proto"], + deps = ["//types"], +) + +go_library( + name = "bgp", + embed = [":bgp_go_proto"], + importpath = "github.com/openconfig/gnoi/bgp", ) diff --git a/cert/BUILD.bazel b/cert/BUILD.bazel index 5c6eb48b..30928193 100644 --- a/cert/BUILD.bazel +++ b/cert/BUILD.bazel @@ -48,5 +48,11 @@ go_proto_library( compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnoi/cert", proto = ":cert_proto", - deps = ["//types:types_go_proto"], + deps = ["//types"], +) + +go_library( + name = "cert", + embed = [":cert_go_proto"], + importpath = "github.com/openconfig/gnoi/cert", ) diff --git a/common/BUILD.bazel b/common/BUILD.bazel index 9b79c47f..773e7609 100644 --- a/common/BUILD.bazel +++ b/common/BUILD.bazel @@ -41,5 +41,11 @@ go_proto_library( name = "common_go_proto", importpath = "github.com/openconfig/gnoi/common", proto = ":common_proto", - deps = ["//types:types_go_proto"], -) \ No newline at end of file + deps = ["//types"], +) + +go_library( + name = "common", + embed = [":common_go_proto"], + importpath = "github.com/openconfig/gnoi/common", +) diff --git a/containerz/BUILD.bazel b/containerz/BUILD.bazel index ca7168e1..e002ef29 100644 --- a/containerz/BUILD.bazel +++ b/containerz/BUILD.bazel @@ -28,9 +28,9 @@ proto_library( name = "containerz_proto", srcs = ["containerz.proto"], deps = [ - "@go_googleapis//google/rpc:status_proto", + "//common:common_proto", "//types:types_proto", - "//common:common_proto" + "@go_googleapis//google/rpc:status_proto", ], ) @@ -52,8 +52,14 @@ go_proto_library( importpath = "github.com/openconfig/gnoi/containerz", proto = ":containerz_proto", deps = [ + "//common", + "//types", "@go_googleapis//google/rpc:status_go_proto", - "//types:types_go_proto", - "//common:common_go_proto" ], -) \ No newline at end of file +) + +go_library( + name = "containerz", + embed = [":containerz_go_proto"], + importpath = "github.com/openconfig/gnoi/containerz", +) diff --git a/debug/BUILD.bazel b/debug/BUILD.bazel index 8eaa70fb..5b2761da 100644 --- a/debug/BUILD.bazel +++ b/debug/BUILD.bazel @@ -50,5 +50,11 @@ go_proto_library( compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnoi/debug", proto = ":debug_proto", - deps = ["//types:types_go_proto"], + deps = ["//types"], +) + +go_library( + name = "debug", + embed = [":debug_go_proto"], + importpath = "github.com/openconfig/gnoi/debug", ) diff --git a/diag/BUILD.bazel b/diag/BUILD.bazel index 074348d2..9cea2c2e 100644 --- a/diag/BUILD.bazel +++ b/diag/BUILD.bazel @@ -51,5 +51,11 @@ go_proto_library( compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnoi/diag", proto = ":diag_proto", - deps = ["//types:types_go_proto"], -) \ No newline at end of file + deps = ["//types"], +) + +go_library( + name = "diag", + embed = [":diag_go_proto"], + importpath = "github.com/openconfig/gnoi/diag", +) diff --git a/factory_reset/BUILD.bazel b/factory_reset/BUILD.bazel index 13fabb4c..0188f2db 100644 --- a/factory_reset/BUILD.bazel +++ b/factory_reset/BUILD.bazel @@ -50,5 +50,11 @@ go_proto_library( compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnoi/factory_reset", proto = ":factory_reset_proto", - deps = ["//types:types_go_proto"], + deps = ["//types"], +) + +go_library( + name = "factory_reset", + embed = [":factory_reset_go_proto"], + importpath = "github.com/openconfig/gnoi/factory_reset", ) diff --git a/file/BUILD.bazel b/file/BUILD.bazel index 5349b82f..e200dde7 100644 --- a/file/BUILD.bazel +++ b/file/BUILD.bazel @@ -52,8 +52,8 @@ go_proto_library( importpath = "github.com/openconfig/gnoi/file", proto = ":file_proto", deps = [ - "//common:common_go_proto", - "//types:types_go_proto", + "//common", + "//types", ], ) diff --git a/healthz/BUILD.bazel b/healthz/BUILD.bazel index 039f3b53..4ad8ad18 100644 --- a/healthz/BUILD.bazel +++ b/healthz/BUILD.bazel @@ -27,8 +27,8 @@ proto_library( name = "healthz_proto", srcs = ["healthz.proto"], deps = [ - "//types:types_proto", "//common:common_proto", + "//types:types_proto", "@com_google_protobuf//:any_proto", "@com_google_protobuf//:timestamp_proto", ], @@ -55,3 +55,4 @@ cc_grpc_library( grpc_only = True, deps = [":healthz_cc_proto"], ) + diff --git a/layer2/BUILD.bazel b/layer2/BUILD.bazel index 63f52094..0837495e 100644 --- a/layer2/BUILD.bazel +++ b/layer2/BUILD.bazel @@ -48,5 +48,11 @@ go_proto_library( compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnoi/layer2", proto = ":layer2_proto", - deps = ["//types:types_go_proto"], + deps = ["//types"], +) + +go_library( + name = "layer2", + embed = [":layer2_go_proto"], + importpath = "github.com/openconfig/gnoi/layer2", ) diff --git a/mpls/BUILD.bazel b/mpls/BUILD.bazel index adf6daa6..9f9340ff 100644 --- a/mpls/BUILD.bazel +++ b/mpls/BUILD.bazel @@ -48,5 +48,11 @@ go_proto_library( compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnoi/mpls", proto = ":mpls_proto", - deps = ["//types:types_go_proto"], + deps = ["//types"], +) + +go_library( + name = "mpls", + embed = [":mpls_go_proto"], + importpath = "github.com/openconfig/gnoi/mpls", ) diff --git a/os/BUILD.bazel b/os/BUILD.bazel index eef88259..b1963bf1 100644 --- a/os/BUILD.bazel +++ b/os/BUILD.bazel @@ -49,5 +49,11 @@ go_proto_library( compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnoi/os", proto = ":os_proto", - deps = ["//types:types_go_proto"], + deps = ["//types"], +) + +go_library( + name = "os", + embed = [":os_go_proto"], + importpath = "github.com/openconfig/gnoi/os", ) diff --git a/otdr/BUILD.bazel b/otdr/BUILD.bazel index 5fc1a8a7..4adf672e 100644 --- a/otdr/BUILD.bazel +++ b/otdr/BUILD.bazel @@ -49,5 +49,11 @@ go_proto_library( compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnoi/otdr", proto = ":otdr_proto", - deps = ["//types:types_go_proto"], + deps = ["//types"], +) + +go_library( + name = "otdr", + embed = [":otdr_go_proto"], + importpath = "github.com/openconfig/gnoi/otdr", ) diff --git a/packet_capture/BUILD.bazel b/packet_capture/BUILD.bazel new file mode 100644 index 00000000..0eaafb11 --- /dev/null +++ b/packet_capture/BUILD.bazel @@ -0,0 +1,24 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") + +proto_library( + name = "pcap_proto", + srcs = ["packet_capture.proto"], + visibility = ["//visibility:public"], +) + +go_proto_library( + name = "pcap_go_proto", + compilers = ["@io_bazel_rules_go//proto:go_grpc"], + importpath = "github.com/openconfig/gnoi/pcap", + proto = ":pcap_proto", + visibility = ["//visibility:public"], +) + +go_library( + name = "pcap", + embed = [":pcap_go_proto"], + importpath = "github.com/openconfig/gnoi/pcap", + visibility = ["//visibility:public"], +) diff --git a/packet_link_qualification/BUILD.bazel b/packet_link_qualification/BUILD.bazel index 249bc3a1..ca12e424 100644 --- a/packet_link_qualification/BUILD.bazel +++ b/packet_link_qualification/BUILD.bazel @@ -21,7 +21,14 @@ go_proto_library( proto = ":linkqual_proto", visibility = ["//visibility:public"], deps = [ - "//types:types_go_proto", + "//types", "@go_googleapis//google/rpc:status_go_proto", ], ) + +go_library( + name = "linkqual", + embed = [":linkqual_go_proto"], + importpath = "github.com/openconfig/gnoi/linkqual", + visibility = ["//visibility:public"], +) diff --git a/system/BUILD.bazel b/system/BUILD.bazel index e1d0d09f..e3324a34 100644 --- a/system/BUILD.bazel +++ b/system/BUILD.bazel @@ -53,7 +53,13 @@ go_proto_library( importpath = "github.com/openconfig/gnoi/system", protos = [":system_proto"], deps = [ - "//common:common_go_proto", - "//types:types_go_proto", + "//common", + "//types", ], ) + +go_library( + name = "system", + embed = [":system_go_proto"], + importpath = "github.com/openconfig/gnoi/system", +) diff --git a/test/BUILD.bazel b/test/BUILD.bazel index 04e4827e..2c0c0638 100644 --- a/test/BUILD.bazel +++ b/test/BUILD.bazel @@ -12,10 +12,10 @@ go_test( srcs = ["simple_test.go"], embed = [":test"], deps = [ - "//bgp:bgp_go_proto", - "//common:common_go_proto", - "//system:system_go_proto", - "//types:types_go_proto", + "//bgp", + "//common", + "//system", + "//types", "@com_github_golang_protobuf//proto:go_default_library", ], ) diff --git a/wavelength_router/BUILD.bazel b/wavelength_router/BUILD.bazel index 67c0e192..3b124142 100644 --- a/wavelength_router/BUILD.bazel +++ b/wavelength_router/BUILD.bazel @@ -49,5 +49,11 @@ go_proto_library( compilers = ["@io_bazel_rules_go//proto:go_grpc"], importpath = "github.com/openconfig/gnoi/wavelength_router", proto = ":wavelength_router_proto", - deps = ["//types:types_go_proto"], + deps = ["//types"], +) + +go_library( + name = "wavelength_router", + embed = [":wavelength_router_go_proto"], + importpath = "github.com/openconfig/gnoi/wavelength_router", )