Skip to content

Commit

Permalink
bazel: quash unnecessary dependency on pkg/util/uuid from protos
Browse files Browse the repository at this point in the history
This dependency can be replaced with a few `# keep` deps in a few choice
proto targets, which is what we should have done the whole time anyway.
This fixes build failures elsewhere in tree -- for example,
`pkg/util/uuid:uuid_test`, which doesn't play nicely with `rules_go` in
the presence of this dependency.

Fixes #59778.

Release note: None
  • Loading branch information
rickystewart committed Feb 10, 2021
1 parent 39f954e commit f43bffb
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion pkg/ccl/utilccl/licenseccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@ go_proto_library(
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/utilccl/licenseccl",
proto = ":licenseccl_proto",
visibility = ["//visibility:public"],
deps = ["@com_github_gogo_protobuf//gogoproto"],
deps = [
"//pkg/util/uuid", # keep
"@com_github_gogo_protobuf//gogoproto",
],
)
2 changes: 0 additions & 2 deletions pkg/cmd/protoc-gen-gogoroach/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ go_proto_compiler(
valid_archive = True,
visibility = ["//visibility:public"],
deps = [
"//pkg/util/uuid",
"@com_github_gogo_protobuf//proto",
"@com_github_gogo_protobuf//sortkeys",
"@com_github_gogo_protobuf//types",
Expand All @@ -61,7 +60,6 @@ go_proto_compiler(
valid_archive = True,
visibility = ["//visibility:public"],
deps = [
"//pkg/util/uuid",
"@com_github_gogo_protobuf//proto",
"@com_github_gogo_protobuf//sortkeys",
"@com_github_gogo_protobuf//types",
Expand Down
1 change: 1 addition & 0 deletions pkg/jobs/jobspb/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ go_proto_library(
"//pkg/sql/schemachanger/scpb",
"//pkg/sql/sem/tree", # keep
"//pkg/util/hlc",
"//pkg/util/uuid", # keep
"@com_github_cockroachdb_errors//errorspb",
"@com_github_gogo_protobuf//gogoproto",
],
Expand Down
1 change: 1 addition & 0 deletions pkg/kv/kvserver/kvserverpb/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ go_proto_library(
"//pkg/roachpb",
"//pkg/storage/enginepb",
"//pkg/util/hlc",
"//pkg/util/uuid", # keep
"@com_github_gogo_protobuf//gogoproto",
],
)
1 change: 1 addition & 0 deletions pkg/kv/kvserver/protectedts/ptpb/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ go_proto_library(
deps = [
"//pkg/roachpb",
"//pkg/util/hlc",
"//pkg/util/uuid", # keep
"@com_github_gogo_protobuf//gogoproto",
"@org_golang_google_genproto//googleapis/api/annotations:go_default_library",
],
Expand Down
1 change: 1 addition & 0 deletions pkg/server/serverpb/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ go_proto_library(
"//pkg/util",
"//pkg/util/log/logpb",
"//pkg/util/metric",
"//pkg/util/uuid", # keep
"@com_github_gogo_protobuf//gogoproto",
# NB: The grpc-gateway compiler injects a dependency on the descriptor
# package that Gazelle isn't prepared to deal with.
Expand Down
1 change: 1 addition & 0 deletions pkg/storage/enginepb/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ go_proto_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/util/hlc",
"//pkg/util/uuid", # keep
"@com_github_gogo_protobuf//gogoproto",
],
)
Expand Down
5 changes: 4 additions & 1 deletion pkg/util/protoutil/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,8 @@ go_proto_library(
importpath = "github.com/cockroachdb/cockroach/pkg/util/protoutil",
proto = ":protoutil_proto",
visibility = ["//visibility:public"],
deps = ["@com_github_gogo_protobuf//gogoproto"],
deps = [
"//pkg/util/uuid", # keep
"@com_github_gogo_protobuf//gogoproto",
],
)

0 comments on commit f43bffb

Please sign in to comment.