Skip to content

Commit e09a6f4

Browse files
jbedarddougthor42
andauthored
deps(gazelle): upgrade rules_go to remove patching of tree-sitter (#3179)
Update rules_go to include bazel-contrib/rules_go#4298 Update gazelle to align with the version the rules_go bzlmod will bring in, and ensure the go.mod version is the same as bzlmod version. Update go to 1.21 to include the `slices` library that some of the go.mod updates depend on. Fixes #2956. --------- Co-authored-by: Douglas Thor <[email protected]>
1 parent 51d9b98 commit e09a6f4

File tree

11 files changed

+109
-186
lines changed

11 files changed

+109
-186
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ END_UNRELEASED_TEMPLATE
5454

5555
{#v0-0-0-changed}
5656
### Changed
57+
* (gazelle) update minimum gazelle version to 0.36.0 - may cause BUILD file changes
58+
* (gazelle) update minimum rules_go version to 0.55.1
59+
* (gazelle) remove custom go-tree-sitter module BUILD file
5760
* (gazelle) For package mode, resolve dependencies when imports are relative
5861
to the package path. This is enabled via the
5962
`# gazelle:python_experimental_allow_relative_imports` true directive ({gh-issue}`2203`).

examples/build_file_generation/WORKSPACE

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2020

2121
http_archive(
2222
name = "io_bazel_rules_go",
23-
sha256 = "278b7ff5a826f3dc10f04feaf0b70d48b68748ccd512d7f98bf442077f043fe3",
23+
sha256 = "9d72f7b8904128afb98d46bbef82ad7223ec9ff3718d419afb355fddd9f9484a",
2424
urls = [
25-
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
26-
"https://github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
25+
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip",
26+
"https://github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip",
2727
],
2828
)
2929

3030
# Download the bazel_gazelle ruleset.
3131
http_archive(
3232
name = "bazel_gazelle",
33-
sha256 = "d3fa66a39028e97d76f9e2db8f1b0c11c099e8e01bf363a923074784e451f809",
33+
sha256 = "75df288c4b31c81eb50f51e2e14f4763cb7548daae126817247064637fd9ea62",
3434
urls = [
35-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz",
36-
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz",
35+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz",
36+
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz",
3737
],
3838
)
3939

@@ -49,7 +49,7 @@ go_rules_dependencies()
4949
# go_rules_dependencies is a function that registers external dependencies
5050
# needed by the Go rules.
5151
# See: https://github.com/bazelbuild/rules_go/blob/master/go/dependencies.rst#go_rules_dependencies
52-
go_register_toolchains(version = "1.19.4")
52+
go_register_toolchains(version = "1.21.13")
5353

5454
# The following call configured the gazelle dependencies, Go environment and Go SDK.
5555
gazelle_dependencies()

examples/bzlmod_build_file_generation/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ local_path_override(
3838
# The following stanza defines the dependency for gazelle
3939
# See here https://github.com/bazelbuild/bazel-gazelle/releases/ for the
4040
# latest version.
41-
bazel_dep(name = "gazelle", version = "0.30.0", repo_name = "bazel_gazelle")
41+
bazel_dep(name = "gazelle", version = "0.36.0", repo_name = "bazel_gazelle")
4242

4343
# The following stanze returns a proxy object representing a module extension;
4444
# its methods can be invoked to create module extension tags.

gazelle/MODULE.bazel

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ module(
66

77
bazel_dep(name = "bazel_skylib", version = "1.6.1")
88
bazel_dep(name = "rules_python", version = "0.18.0")
9-
bazel_dep(name = "rules_go", version = "0.41.0", repo_name = "io_bazel_rules_go")
10-
bazel_dep(name = "gazelle", version = "0.33.0", repo_name = "bazel_gazelle")
9+
bazel_dep(name = "rules_go", version = "0.55.1", repo_name = "io_bazel_rules_go")
10+
bazel_dep(name = "gazelle", version = "0.36.0", repo_name = "bazel_gazelle")
1111
bazel_dep(name = "rules_cc", version = "0.0.16")
1212

1313
local_path_override(
@@ -23,21 +23,12 @@ use_repo(
2323
"com_github_bmatcuk_doublestar_v4",
2424
"com_github_emirpasic_gods",
2525
"com_github_ghodss_yaml",
26+
"com_github_smacker_go_tree_sitter",
2627
"com_github_stretchr_testify",
2728
"in_gopkg_yaml_v2",
2829
"org_golang_x_sync",
2930
)
3031

31-
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
32-
33-
http_archive(
34-
name = "com_github_smacker_go_tree_sitter",
35-
build_file = "//:internal/smacker_BUILD.bazel",
36-
integrity = "sha256-4AkDY4Rh5Auu9Kwzhj5XYSirMLlhmd6ClMWo/r0kmu4=",
37-
strip_prefix = "go-tree-sitter-dd81d9e9be82a8cac96ed1d50c7389c5f1997c02",
38-
url = "https://github.com/smacker/go-tree-sitter/archive/dd81d9e9be82a8cac96ed1d50c7389c5f1997c02.zip",
39-
)
40-
4132
python_stdlib_list = use_extension("//python:extensions.bzl", "python_stdlib_list")
4233
use_repo(
4334
python_stdlib_list,

gazelle/WORKSPACE

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44

55
http_archive(
66
name = "io_bazel_rules_go",
7-
sha256 = "278b7ff5a826f3dc10f04feaf0b70d48b68748ccd512d7f98bf442077f043fe3",
7+
sha256 = "9d72f7b8904128afb98d46bbef82ad7223ec9ff3718d419afb355fddd9f9484a",
88
urls = [
9-
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
10-
"https://github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
9+
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip",
10+
"https://github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip",
1111
],
1212
)
1313

1414
http_archive(
1515
name = "bazel_gazelle",
16-
sha256 = "29d5dafc2a5582995488c6735115d1d366fcd6a0fc2e2a153f02988706349825",
16+
sha256 = "75df288c4b31c81eb50f51e2e14f4763cb7548daae126817247064637fd9ea62",
1717
urls = [
18-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.0/bazel-gazelle-v0.31.0.tar.gz",
19-
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.0/bazel-gazelle-v0.31.0.tar.gz",
18+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz",
19+
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz",
2020
],
2121
)
2222

@@ -25,7 +25,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe
2525

2626
go_rules_dependencies()
2727

28-
go_register_toolchains(version = "1.19.4")
28+
go_register_toolchains(version = "1.21.13")
2929

3030
gazelle_dependencies()
3131

gazelle/deps.bzl

Lines changed: 60 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -46,31 +46,28 @@ def go_deps():
4646
go_repository(
4747
name = "com_github_bazelbuild_bazel_gazelle",
4848
importpath = "github.com/bazelbuild/bazel-gazelle",
49-
sum = "h1:ROyUyUHzoEdvoOs1e0haxJx1l5EjZX6AOqiKdVlaBbg=",
50-
version = "v0.31.1",
49+
sum = "h1:n41ODckCkU9D2BEwBxYN+xu5E92Vd0gaW6QmsIW9l00=",
50+
version = "v0.36.0",
5151
)
52-
5352
go_repository(
5453
name = "com_github_bazelbuild_buildtools",
5554
build_naming_convention = "go_default_library",
5655
importpath = "github.com/bazelbuild/buildtools",
57-
sum = "h1:HTepWP/jhtWTC1gvK0RnvKCgjh4gLqiwaOwGozAXcbw=",
58-
version = "v0.0.0-20231103205921-433ea8554e82",
56+
sum = "h1:VNqmvOfFzn2Hrtoni8vqgXlIQ4C2Zt22fxeZ9gOOkp0=",
57+
version = "v0.0.0-20240313121412-66c605173954",
5958
)
6059
go_repository(
6160
name = "com_github_bazelbuild_rules_go",
6261
importpath = "github.com/bazelbuild/rules_go",
63-
sum = "h1:JzlRxsFNhlX+g4drDRPhIaU5H5LnI978wdMJ0vK4I+k=",
64-
version = "v0.41.0",
62+
sum = "h1:cQYGcunY8myOB+0Ym6PGQRhc/milkRcNv0my3XgxaDU=",
63+
version = "v0.55.1",
6564
)
66-
6765
go_repository(
6866
name = "com_github_bmatcuk_doublestar_v4",
6967
importpath = "github.com/bmatcuk/doublestar/v4",
7068
sum = "h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q=",
7169
version = "v4.7.1",
7270
)
73-
7471
go_repository(
7572
name = "com_github_burntsushi_toml",
7673
importpath = "github.com/BurntSushi/toml",
@@ -134,16 +131,21 @@ def go_deps():
134131
go_repository(
135132
name = "com_github_fsnotify_fsnotify",
136133
importpath = "github.com/fsnotify/fsnotify",
137-
sum = "h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=",
138-
version = "v1.6.0",
134+
sum = "h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=",
135+
version = "v1.7.0",
139136
)
140-
141137
go_repository(
142138
name = "com_github_ghodss_yaml",
143139
importpath = "github.com/ghodss/yaml",
144140
sum = "h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=",
145141
version = "v1.0.0",
146142
)
143+
go_repository(
144+
name = "com_github_gogo_protobuf",
145+
importpath = "github.com/gogo/protobuf",
146+
sum = "h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=",
147+
version = "v1.3.2",
148+
)
147149
go_repository(
148150
name = "com_github_golang_glog",
149151
importpath = "github.com/golang/glog",
@@ -153,20 +155,20 @@ def go_deps():
153155
go_repository(
154156
name = "com_github_golang_mock",
155157
importpath = "github.com/golang/mock",
156-
sum = "h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=",
157-
version = "v1.6.0",
158+
sum = "h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/U=",
159+
version = "v1.7.0-rc.1",
158160
)
159161
go_repository(
160162
name = "com_github_golang_protobuf",
161163
importpath = "github.com/golang/protobuf",
162-
sum = "h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=",
163-
version = "v1.5.2",
164+
sum = "h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=",
165+
version = "v1.5.4",
164166
)
165167
go_repository(
166168
name = "com_github_google_go_cmp",
167169
importpath = "github.com/google/go-cmp",
168-
sum = "h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=",
169-
version = "v0.5.9",
170+
sum = "h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=",
171+
version = "v0.6.0",
170172
)
171173
go_repository(
172174
name = "com_github_pmezard_go_difflib",
@@ -180,12 +182,11 @@ def go_deps():
180182
sum = "h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=",
181183
version = "v0.0.0-20190812154241-14fe0d1b01d4",
182184
)
183-
http_archive(
185+
go_repository(
184186
name = "com_github_smacker_go_tree_sitter",
185-
build_file = Label("//:internal/smacker_BUILD.bazel"),
186-
integrity = "sha256-4AkDY4Rh5Auu9Kwzhj5XYSirMLlhmd6ClMWo/r0kmu4=",
187-
strip_prefix = "go-tree-sitter-dd81d9e9be82a8cac96ed1d50c7389c5f1997c02",
188-
url = "https://github.com/smacker/go-tree-sitter/archive/dd81d9e9be82a8cac96ed1d50c7389c5f1997c02.zip",
187+
importpath = "github.com/smacker/go-tree-sitter",
188+
sum = "h1:6C8qej6f1bStuePVkLSFxoU22XBS165D3klxlzRg8F4=",
189+
version = "v0.0.0-20240827094217-dd81d9e9be82",
189190
)
190191
go_repository(
191192
name = "com_github_stretchr_objx",
@@ -199,13 +200,6 @@ def go_deps():
199200
sum = "h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=",
200201
version = "v1.9.0",
201202
)
202-
203-
go_repository(
204-
name = "com_github_yuin_goldmark",
205-
importpath = "github.com/yuin/goldmark",
206-
sum = "h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=",
207-
version = "v1.4.13",
208-
)
209203
go_repository(
210204
name = "com_google_cloud_go",
211205
importpath = "cloud.google.com/go",
@@ -230,7 +224,6 @@ def go_deps():
230224
sum = "h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=",
231225
version = "v3.0.1",
232226
)
233-
234227
go_repository(
235228
name = "net_starlark_go",
236229
importpath = "go.starlark.net",
@@ -246,20 +239,32 @@ def go_deps():
246239
go_repository(
247240
name = "org_golang_google_genproto",
248241
importpath = "google.golang.org/genproto",
249-
sum = "h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=",
250-
version = "v0.0.0-20200526211855-cb27e3aa2013",
242+
sum = "h1:387Y+JbxF52bmesc8kq1NyYIp33dnxCw6eiA7JMsTmw=",
243+
version = "v0.0.0-20250115164207-1a7da9e5054f",
244+
)
245+
go_repository(
246+
name = "org_golang_google_genproto_googleapis_rpc",
247+
importpath = "google.golang.org/genproto/googleapis/rpc",
248+
sum = "h1:3UsHvIr4Wc2aW4brOaSCmcxh9ksica6fHEr8P1XhkYw=",
249+
version = "v0.0.0-20250106144421-5f5ef82da422",
251250
)
252251
go_repository(
253252
name = "org_golang_google_grpc",
254253
importpath = "google.golang.org/grpc",
255-
sum = "h1:fPVVDxY9w++VjTZsYvXWqEf9Rqar/e+9zYfxKK+W+YU=",
256-
version = "v1.50.0",
254+
sum = "h1:OgPcDAFKHnH8X3O4WcO4XUc8GRDeKsKReqbQtiCj7N8=",
255+
version = "v1.67.3",
256+
)
257+
go_repository(
258+
name = "org_golang_google_grpc_cmd_protoc_gen_go_grpc",
259+
importpath = "google.golang.org/grpc/cmd/protoc-gen-go-grpc",
260+
sum = "h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A=",
261+
version = "v1.5.1",
257262
)
258263
go_repository(
259264
name = "org_golang_google_protobuf",
260265
importpath = "google.golang.org/protobuf",
261-
sum = "h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=",
262-
version = "v1.28.0",
266+
sum = "h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU=",
267+
version = "v1.36.3",
263268
)
264269
go_repository(
265270
name = "org_golang_x_crypto",
@@ -282,14 +287,14 @@ def go_deps():
282287
go_repository(
283288
name = "org_golang_x_mod",
284289
importpath = "golang.org/x/mod",
285-
sum = "h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=",
286-
version = "v0.10.0",
290+
sum = "h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=",
291+
version = "v0.23.0",
287292
)
288293
go_repository(
289294
name = "org_golang_x_net",
290295
importpath = "golang.org/x/net",
291-
sum = "h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=",
292-
version = "v0.10.0",
296+
sum = "h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=",
297+
version = "v0.35.0",
293298
)
294299
go_repository(
295300
name = "org_golang_x_oauth2",
@@ -300,29 +305,35 @@ def go_deps():
300305
go_repository(
301306
name = "org_golang_x_sync",
302307
importpath = "golang.org/x/sync",
303-
sum = "h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=",
304-
version = "v0.2.0",
308+
sum = "h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=",
309+
version = "v0.11.0",
305310
)
306311
go_repository(
307312
name = "org_golang_x_sys",
308313
importpath = "golang.org/x/sys",
309-
sum = "h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=",
310-
version = "v0.8.0",
314+
sum = "h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=",
315+
version = "v0.30.0",
311316
)
312317
go_repository(
313318
name = "org_golang_x_text",
314319
importpath = "golang.org/x/text",
315-
sum = "h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=",
316-
version = "v0.3.3",
320+
sum = "h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=",
321+
version = "v0.22.0",
317322
)
318323
go_repository(
319324
name = "org_golang_x_tools",
320325
build_directives = [
321326
"gazelle:exclude **/testdata/**/*",
322327
],
323328
importpath = "golang.org/x/tools",
324-
sum = "h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo=",
325-
version = "v0.9.1",
329+
sum = "h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=",
330+
version = "v0.30.0",
331+
)
332+
go_repository(
333+
name = "org_golang_x_tools_go_vcs",
334+
importpath = "golang.org/x/tools/go/vcs",
335+
sum = "h1:cOIJqWBl99H1dH5LWizPa+0ImeeJq3t3cJjaeOWUAL4=",
336+
version = "v0.1.0-deprecated",
326337
)
327338
go_repository(
328339
name = "org_golang_x_xerrors",

gazelle/go.mod

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
module github.com/bazel-contrib/rules_python/gazelle
22

3-
go 1.19
3+
go 1.21.13
44

55
require (
6-
github.com/bazelbuild/bazel-gazelle v0.31.1
7-
github.com/bazelbuild/buildtools v0.0.0-20231103205921-433ea8554e82
8-
github.com/bazelbuild/rules_go v0.41.0
6+
github.com/bazelbuild/bazel-gazelle v0.36.0
7+
github.com/bazelbuild/buildtools v0.0.0-20240313121412-66c605173954
8+
github.com/bazelbuild/rules_go v0.55.1
99
github.com/bmatcuk/doublestar/v4 v4.7.1
1010
github.com/emirpasic/gods v1.18.1
1111
github.com/ghodss/yaml v1.0.0
1212
github.com/smacker/go-tree-sitter v0.0.0-20240827094217-dd81d9e9be82
1313
github.com/stretchr/testify v1.9.0
14-
golang.org/x/sync v0.2.0
14+
golang.org/x/sync v0.11.0
1515
gopkg.in/yaml.v2 v2.4.0
1616
)
1717

1818
require (
1919
github.com/davecgh/go-spew v1.1.1 // indirect
20-
github.com/google/go-cmp v0.5.9 // indirect
20+
github.com/google/go-cmp v0.6.0 // indirect
2121
github.com/pmezard/go-difflib v1.0.0 // indirect
22-
golang.org/x/mod v0.10.0 // indirect
23-
golang.org/x/sys v0.8.0 // indirect
24-
golang.org/x/tools v0.9.1 // indirect
22+
golang.org/x/mod v0.23.0 // indirect
23+
golang.org/x/sys v0.30.0 // indirect
24+
golang.org/x/tools/go/vcs v0.1.0-deprecated // indirect
2525
gopkg.in/yaml.v3 v3.0.1 // indirect
2626
)

0 commit comments

Comments
 (0)