Skip to content

Commit

Permalink
Don't forget to upgrade Gazelle
Browse files Browse the repository at this point in the history
We've bumped the version in MODULE.bazel, but haven't updated the
git_repository() that goes along with it.
  • Loading branch information
EdSchouten committed Jun 22, 2024
1 parent e7e069d commit 8abc648
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 1,797 deletions.
3 changes: 1 addition & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ bazel_dep(name = "toolchains_llvm", version = "1.0.0")

git_override(
module_name = "gazelle",
commit = "f5a5c5dc90b4d6a39f0f47d770eba27c6c1c1877",
init_submodules = True,
commit = "4d0129d7adae33e8e648d3624aff8fa8f93f375b",
patches = [
"//:patches/gazelle/dont-flatten-srcs.diff",
"//:patches/gazelle/googleapis.diff",
Expand Down
1,764 changes: 0 additions & 1,764 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/bb_replicator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ go_library(
"//pkg/proto/configuration/bb_replicator",
"//pkg/proto/replicator",
"//pkg/util",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
],
Expand Down
2 changes: 1 addition & 1 deletion cmd/bb_storage/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ go_library(
"//pkg/util",
"@com_github_bazelbuild_remote_apis//build/bazel/remote/execution/v2:execution",
"@org_golang_google_genproto_googleapis_bytestream//:bytestream",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
],
Expand Down
30 changes: 15 additions & 15 deletions patches/gazelle/dont-flatten-srcs.diff
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
diff --git language/go/generate.go language/go/generate.go
index 53e397a..38855c6 100644
index 9e3ed9a..af460a1 100644
--- language/go/generate.go
+++ language/go/generate.go
@@ -483,7 +483,7 @@ func (g *generator) generateLib(pkg *goPackage, embed string) *rule.Rule {
@@ -594,7 +594,7 @@ func (g *generator) generateLib(pkg *goPackage, embeds []string) *rule.Rule {
} else {
visibility = g.commonVisibility(pkg.importPath)
}
- g.setCommonAttrs(goLibrary, pkg.rel, visibility, pkg.library, embed)
+ g.setCommonAttrs(goLibrary, pkg.rel, visibility, pkg.library, embed, true)
- g.setCommonAttrs(goLibrary, pkg.rel, visibility, pkg.library, embeds)
+ g.setCommonAttrs(goLibrary, pkg.rel, visibility, pkg.library, embeds, true)
g.setImportAttrs(goLibrary, pkg.importPath)
return goLibrary
}
@@ -512,7 +512,7 @@ func (g *generator) generateBin(pkg *goPackage, library string) *rule.Rule {
@@ -623,7 +623,7 @@ func (g *generator) generateBin(pkg *goPackage, library string) *rule.Rule {
return goBinary // empty
}
visibility := g.commonVisibility(pkg.importPath)
- g.setCommonAttrs(goBinary, pkg.rel, visibility, pkg.binary, library)
+ g.setCommonAttrs(goBinary, pkg.rel, visibility, pkg.binary, library, true)
- g.setCommonAttrs(goBinary, pkg.rel, visibility, pkg.binary, []string{library})
+ g.setCommonAttrs(goBinary, pkg.rel, visibility, pkg.binary, []string{library}, true)
return goBinary
}

@@ -552,7 +552,7 @@ func (g *generator) generateTests(pkg *goPackage, library string) []*rule.Rule {
if test.hasInternalTest {
embed = library
@@ -665,7 +665,7 @@ func (g *generator) generateTests(pkg *goPackage, library string) []*rule.Rule {
embeds = append(embeds, library)
}
}
- g.setCommonAttrs(goTest, pkg.rel, nil, test, embed)
+ g.setCommonAttrs(goTest, pkg.rel, nil, test, embed, false)
- g.setCommonAttrs(goTest, pkg.rel, nil, test, embeds)
+ g.setCommonAttrs(goTest, pkg.rel, nil, test, embeds, false)
if pkg.hasTestdata {
goTest.SetAttr("data", rule.GlobValue{Patterns: []string{"testdata/**"}})
}
@@ -629,9 +629,13 @@ func (g *generator) maybeGenerateExtraLib(lib *rule.Rule, pkg *goPackage) *rule.
@@ -718,9 +718,13 @@ func (g *generator) maybeGenerateExtraLib(lib *rule.Rule, pkg *goPackage) *rule.
return r
}

-func (g *generator) setCommonAttrs(r *rule.Rule, pkgRel string, visibility []string, target goTarget, embed string) {
+func (g *generator) setCommonAttrs(r *rule.Rule, pkgRel string, visibility []string, target goTarget, embed string, flattenSrcs bool) {
-func (g *generator) setCommonAttrs(r *rule.Rule, pkgRel string, visibility []string, target goTarget, embeds []string) {
+func (g *generator) setCommonAttrs(r *rule.Rule, pkgRel string, visibility []string, target goTarget, embeds []string, flattenSrcs bool) {
if !target.sources.isEmpty() {
- r.SetAttr("srcs", target.sources.buildFlat())
+ if flattenSrcs {
Expand Down
8 changes: 4 additions & 4 deletions patches/gazelle/googleapis.diff
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
diff --git MODULE.bazel MODULE.bazel
index ba9c3c6..11e927b 100644
index d821962..19efede 100644
--- MODULE.bazel
+++ MODULE.bazel
@@ -64,3 +64,5 @@ use_repo(
go_sdk_dev,
go_sdk = "go_default_sdk",
@@ -75,3 +75,5 @@ single_version_override(
patch_strip = 1,
patches = ["//third_party/patches:rules_go.patch"],
)
+
+bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5")
4 changes: 2 additions & 2 deletions pkg/blobstore/grpcclients/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ go_library(
"@com_github_bazelbuild_remote_apis//build/bazel/remote/execution/v2:execution",
"@com_github_google_uuid//:uuid",
"@org_golang_google_genproto_googleapis_bytestream//:bytestream",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
],
Expand All @@ -44,7 +44,7 @@ go_test(
"@com_github_google_uuid//:uuid",
"@com_github_stretchr_testify//require",
"@org_golang_google_genproto_googleapis_bytestream//:bytestream",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
"@org_golang_google_protobuf//proto",
Expand Down
2 changes: 1 addition & 1 deletion pkg/blobstore/grpcservers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ go_test(
"@com_github_stretchr_testify//require",
"@org_golang_google_genproto_googleapis_bytestream//:bytestream",
"@org_golang_google_genproto_googleapis_rpc//status",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
"@org_golang_google_grpc//test/bufconn",
Expand Down
2 changes: 1 addition & 1 deletion pkg/blobstore/replication/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ go_library(
"//pkg/proto/replicator",
"//pkg/util",
"@com_github_bazelbuild_remote_apis//build/bazel/remote/execution/v2:execution",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
"@org_golang_google_protobuf//encoding/protowire",
Expand Down
4 changes: 2 additions & 2 deletions pkg/builder/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ go_library(
"//pkg/util",
"@com_github_bazelbuild_remote_apis//build/bazel/remote/execution/v2:execution",
"@com_google_cloud_go_longrunning//autogen/longrunningpb",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
"@org_golang_google_protobuf//proto",
Expand All @@ -44,7 +44,7 @@ go_test(
"@com_github_golang_mock//gomock",
"@com_github_stretchr_testify//require",
"@com_google_cloud_go_longrunning//autogen/longrunningpb",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
"@org_golang_google_protobuf//proto",
Expand Down
2 changes: 1 addition & 1 deletion pkg/global/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ go_library(
"@io_opentelemetry_go_otel_sdk//resource",
"@io_opentelemetry_go_otel_sdk//trace",
"@io_opentelemetry_go_otel_trace//:trace",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//resolver",
"@org_golang_google_grpc//status",
Expand Down
4 changes: 2 additions & 2 deletions pkg/grpc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ go_library(
"@io_opentelemetry_go_contrib_instrumentation_google_golang_org_grpc_otelgrpc//:otelgrpc",
"@io_opentelemetry_go_otel//attribute",
"@io_opentelemetry_go_otel_trace//:trace",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//credentials",
"@org_golang_google_grpc//credentials/oauth",
Expand Down Expand Up @@ -133,7 +133,7 @@ go_test(
"@io_opentelemetry_go_otel//attribute",
"@io_opentelemetry_go_otel_trace//:trace",
"@io_opentelemetry_go_proto_otlp//common/v1:common",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//credentials",
"@org_golang_google_grpc//metadata",
Expand Down
2 changes: 1 addition & 1 deletion pkg/otel/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ go_library(
"@io_opentelemetry_go_proto_otlp//collector/trace/v1:trace",
"@io_opentelemetry_go_proto_otlp//common/v1:common",
"@io_opentelemetry_go_proto_otlp//trace/v1:trace",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
],
Expand Down

0 comments on commit 8abc648

Please sign in to comment.