Skip to content

Commit

Permalink
Bump rules_go & Bazel deps
Browse files Browse the repository at this point in the history
Not updating to rules_go 0.50.1 quite yet as that runs into issues with nogo.

Bumping the compatibility SDK is needed due to changes to `golang.org/x/tools` that require Go 1.19 (`types.Func.Origin()`).
  • Loading branch information
fmeum committed Nov 6, 2024
1 parent 3c129b3 commit 60e1514
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.2.1
7.4.0
4 changes: 2 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ gazelle_binary(
)

go_cross_binary(
name = "gazelle_local_go1.18",
sdk_version = "1.18",
name = "gazelle_local_go1.19",
sdk_version = "1.19",
target = ":gazelle_local",
)

Expand Down
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.4.1", dev_dependenc
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc")

go_sdk_dev = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk", dev_dependency = True)
go_sdk_dev.download(version = "1.22.5")
go_sdk_dev.download(version = "1.23.2")

# Used by compatibility tests, keep as low as possible.
go_sdk_dev.download(version = "1.18.10")
go_sdk_dev.download(version = "1.19.13")

# Known to exist since it is instantiated by rules_go itself.
use_repo(
Expand Down
30 changes: 25 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_bazel_rules_go",
sha256 = "80a98277ad1311dacd837f9b16db62887702e9f1d1c4c9f796d0121a46c8e184",
sha256 = "d93ef02f1e72c82d8bb3d5169519b36167b33cf68c252525e3b9d3d5dd143de7",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.49.0/rules_go-v0.49.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.49.0/rules_go-v0.49.0.zip",
],
)

Expand All @@ -40,18 +40,38 @@ go_rules_dependencies()

go_register_toolchains(
nogo = "@bazel_gazelle//:nogo",
version = "1.22.5",
version = "1.23.2",
)

go_download_sdk(
name = "go_compat_sdk",
version = "1.18.10",
version = "1.19.13",
)

load("//:deps.bzl", "gazelle_dependencies")

gazelle_dependencies(go_sdk = "go_sdk")

# Needed by rules_go when using proto rules, but not provided by its deps macro.
http_archive(
name = "rules_proto",
sha256 = "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295",
strip_prefix = "rules_proto-6.0.2",
url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.2/rules_proto-6.0.2.tar.gz",
)

load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")

rules_proto_dependencies()

load("@rules_proto//proto:setup.bzl", "rules_proto_setup")

rules_proto_setup()

load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")

rules_proto_toolchains()

# For API doc generation
# This is a dev dependency, users should not need to install it
# so we declare it in the WORKSPACE
Expand Down
6 changes: 3 additions & 3 deletions cmd/fetch_repo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ go_binary(
visibility = ["//visibility:public"],
)

# Verify that fetch_repo builds with Go 1.18.
# Verify that fetch_repo builds with Go 1.19.
go_cross_binary(
name = "fetch_repo_go1.18",
sdk_version = "1.18",
name = "fetch_repo_go1.19",
sdk_version = "1.19",
target = ":fetch_repo",
)

Expand Down
2 changes: 1 addition & 1 deletion tests/bcr/go_mod/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.2.1
7.4.0
2 changes: 1 addition & 1 deletion tests/bcr/go_work/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.2.1
7.4.0

0 comments on commit 60e1514

Please sign in to comment.