treewide: bump rules_go to v0.54.0
This includes a fix for the gopackagesdriver not finding standard
library files:
https://github.com/bazel-contrib/rules_go/commit/cf3c3af34bd869b864f5f2b98e2f41c2b220d6c9
The gopackagesdriver problem appeared with commit 0fd36f458729 which
enabled pure Go globally. rules_go runs `go list` to obtain standard
library files. When pure is enabled, `-compiled=true` is not passed to
the list command, and then the output does not include CompiledGoFiles,
only GoFiles (see `go help list`). But gopls always expects
CompiledGoFiles to be present.
Change-Id: Ide2eaae5aa45510cf83c7a8691cb0af3e112ebf9
Reviewed-on: https://review.monogon.dev/c/monogon/+/4211
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/MODULE.bazel b/MODULE.bazel
index fc9e97f..689e684 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -17,7 +17,7 @@
"//third_party/rules_go:rules_go_absolute_embedsrc.patch",
"//third_party/rules_go:introduce-all-scope-for-nogo.patch",
],
- version = "0.53.0",
+ version = "0.54.0",
)
bazel_dep(name = "gazelle")
diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock
index fed4caa..1fe8c17 100644
--- a/MODULE.bazel.lock
+++ b/MODULE.bazel.lock
@@ -99,8 +99,8 @@
"https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6",
"https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8",
"https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e",
- "https://bcr.bazel.build/modules/rules_go/0.53.0/MODULE.bazel": "a4ed760d3ac0dbc0d7b967631a9a3fd9100d28f7d9fcf214b4df87d4bfff5f9a",
- "https://bcr.bazel.build/modules/rules_go/0.53.0/source.json": "c6dc34fb5bb8838652221a167d8f35ca3c8fdcbff8568f13cc75719802f95cff",
+ "https://bcr.bazel.build/modules/rules_go/0.54.0/MODULE.bazel": "ebec39ed510d0d4122b60764623dda92ca7f175479b511bf7cd5de7f38e86747",
+ "https://bcr.bazel.build/modules/rules_go/0.54.0/source.json": "6eb9b4f4fc27ab5be79d84dcfcf971beea6caa91a1b02088a9ee314c88915cf3",
"https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74",
"https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86",
"https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39",
diff --git a/go.mod b/go.mod
index b4b41ab..5077a2b 100644
--- a/go.mod
+++ b/go.mod
@@ -55,7 +55,7 @@
cloud.google.com/go/storage v1.43.0
git.dolansoft.org/dolansoft/k8s-nft-npc v0.0.0-20250227164540-47778d43dcec
github.com/adrg/xdg v0.4.0
- github.com/bazelbuild/rules_go v0.53.0
+ github.com/bazelbuild/rules_go v0.54.0
github.com/cavaliergopher/cpio v1.0.1
github.com/cenkalti/backoff/v4 v4.3.0
github.com/cockroachdb/cockroach-go/v2 v2.2.10
diff --git a/go.sum b/go.sum
index 5ea0d0f..c35454b 100644
--- a/go.sum
+++ b/go.sum
@@ -1576,8 +1576,8 @@
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=
github.com/bazelbuild/buildtools v0.0.0-20231103205921-433ea8554e82 h1:HTepWP/jhtWTC1gvK0RnvKCgjh4gLqiwaOwGozAXcbw=
github.com/bazelbuild/buildtools v0.0.0-20231103205921-433ea8554e82/go.mod h1:689QdV3hBP7Vo9dJMmzhoYIyo/9iMhEmHkJcnaPRCbo=
-github.com/bazelbuild/rules_go v0.53.0 h1:u160DT+RRb+Xb2aSO4piN8xhs4aZvWz2UDXCq48F4ao=
-github.com/bazelbuild/rules_go v0.53.0/go.mod h1:xB1jfsYHWlnZyPPxzlOSst4q2ZAwS251Mp9Iw6TPuBc=
+github.com/bazelbuild/rules_go v0.54.0 h1:D9aCU7j5rdRxg2rXOZX5zHZ395XC0KbgC4rnyaQ3ofM=
+github.com/bazelbuild/rules_go v0.54.0/go.mod h1:T90Gpyq4HDFlsrvtQa2CBdHNJ2P4rAu/uUTmQbanzf0=
github.com/beevik/ntp v1.4.3 h1:PlbTvE5NNy4QHmA4Mg57n7mcFTmr1W1j3gcK7L1lqho=
github.com/beevik/ntp v1.4.3/go.mod h1:Unr8Zg+2dRn7d8bHFuehIMSvvUYssHMxW3Q5Nx4RW5Q=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
diff --git a/third_party/rules_go/introduce-all-scope-for-nogo.patch b/third_party/rules_go/introduce-all-scope-for-nogo.patch
index a79591e..e4e35c2 100644
--- a/third_party/rules_go/introduce-all-scope-for-nogo.patch
+++ b/third_party/rules_go/introduce-all-scope-for-nogo.patch
@@ -1,17 +1,14 @@
-From f5a801460e8408c075c4654f33bc0c395b9265de Mon Sep 17 00:00:00 2001
-From: Fabian Meumertzheim <fabian@meumertzhe.im>
-Date: Sun, 16 Feb 2025 23:26:59 +0100
-Subject: [PATCH] Introduce `["all"]` scope for nogo
+commit 7c26118cffcb3d01bf5f668c4ca563c33d20814a
+Author: Fabian Meumertzheim <fabian@meumertzhe.im>
+Date: Sun Feb 16 23:26:59 2025 +0100
----
- go/private/extensions.bzl | 53 +++++++++++++++++++++++----------------
- 1 file changed, 32 insertions(+), 21 deletions(-)
+ Introduce `["all"]` scope for nogo
diff --git a/go/private/extensions.bzl b/go/private/extensions.bzl
-index a5c8fc9bbd..ea46dec35f 100644
+index a53dc6e3..8636b385 100644
--- a/go/private/extensions.bzl
+++ b/go/private/extensions.bzl
-@@ -74,16 +74,15 @@ _nogo_tag = tag_class(
+@@ -79,16 +79,15 @@ _nogo_tag = tag_class(
),
"includes": attr.label_list(
default = NOGO_DEFAULT_INCLUDES,
@@ -31,7 +28,7 @@
""",
),
"excludes": attr.label_list(
-@@ -111,11 +110,9 @@ _MAX_NUM_TOOLCHAINS = 9999
+@@ -144,11 +143,9 @@ _MAX_NUM_TOOLCHAINS = 9999
_TOOLCHAIN_INDEX_PAD_LENGTH = len(str(_MAX_NUM_TOOLCHAINS))
def _go_sdk_impl(ctx):
@@ -46,14 +43,14 @@
for module in ctx.modules:
if not module.is_root or not module.tags.nogo:
continue
-@@ -126,22 +123,26 @@ def _go_sdk_impl(ctx):
+@@ -159,22 +156,26 @@ def _go_sdk_impl(ctx):
*[t for p in zip(module.tags.nogo, len(module.tags.nogo) * ["\n"]) for t in p]
)
nogo_tag = module.tags.nogo[0]
- for scope in nogo_tag.includes + nogo_tag.excludes:
- # Validate that the scope references a valid, visible repository.
- # buildifier: disable=no-effect
-- scope.workspace_name
+- scope.repo_name
- if scope.name != "__pkg__" and scope.name != "__subpackages__":
- fail(
- "go_sdk.nogo: all entries in includes and excludes must end with ':__pkg__' or ':__subpackages__', got '{}' in".format(scope.name),
@@ -85,14 +82,14 @@
)
multi_version_module = {}
-@@ -300,6 +301,16 @@ def _go_sdk_impl(ctx):
+@@ -374,6 +375,16 @@ def _go_sdk_impl(ctx):
else:
return None
+def _check_nogo_scope(scope, nogo_tag):
+ # Validate that the scope references a valid, visible repository.
+ # buildifier: disable=no-effect
-+ scope.workspace_name
++ scope.repo_name
+ if scope.name != "__pkg__" and scope.name != "__subpackages__":
+ fail(
+ "go_sdk.nogo: all entries in includes and excludes must end with ':__pkg__' or ':__subpackages__', got '{}' in".format(scope.name),
@@ -100,5 +97,5 @@
+ )
+
def _default_go_sdk_name(*, module, multi_version, tag_type, index, suffix = ""):
- # Keep the version out of the repository name if possible to prevent unnecessary rebuilds when
- # it changes.
+ # Keep the version and name of the root module out of the repository name if possible to
+ # prevent unnecessary rebuilds when it changes.