Skip to content

Commit eb62671

Browse files
craig[bot]rickystewart
andcommitted
Merge #140626
140626: build: upgrade to go 1.23.6 r=rail,RaduBerinde a=rickystewart * [ ] Adjust the Pebble tests to run in new version. * [x] Update [our `go` fork](https://github.com/cockroachdb/go) with a new branch containing our patches. Create a new branch `cockroach-go$GO_VERSION` and take note of the commit ID. * [x] Update `build/teamcity/internal/release/build-and-publish-patched-go/commit.txt` with the commit ID in the `go` fork. * [x] Update `build/teamcity/internal/release/build-and-publish-patched-go/impl.sh` with the new `GOVERS` and adjust SHA256 sums as necessary. * [x] Adjust `GO_FIPS_COMMIT` for the FIPS Go toolchain ([source](./teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh)). * [x] Run the `Internal / Cockroach / Build / Toolchains / Publish Patched Go for Mac` build configuration in TeamCity with your latest version of the script above. Note the job depends on another job `Build and Publish Patched Go`. That job prints out the SHA256 of all tarballs, which you will need to copy-paste into `WORKSPACE` (see below). `Publish Patched Go for Mac` is an extra step that publishes the *signed* `go` binaries for macOS. That job also prints out the SHA256 of the Mac tarballs in particular. * [x] Adjust `--`@io_bazel_rules_go//go/toolchain:sdk_version`` in [.bazelrc](../.bazelrc). * [x] Bump the version in `WORKSPACE` under `go_download_sdk`. You may need to bump [rules_go](https://github.com/bazelbuild/rules_go/releases). Also edit the filenames listed in `sdks` and update all the hashes to match what you built in the step above. * [x] Bump the version in `WORKSPACE` under `go_download_sdk` for the FIPS version of Go (`go_sdk_fips`). * [x] Run `./dev generate bazel` to refresh `distdir_files.bzl`, then `bazel fetch `@distdir//:archives`` to ensure you've updated all hashes to the correct value. * [x] Bump the go version in `go.mod`. * [x] Bump the default installed version of Go in `bootstrap-debian.sh` ([source](./bootstrap/bootstrap-debian.sh)). * [x] Replace other mentions of the older version of go (grep for `golang:<old_version>` and `go<old_version>`). Epic: [CRDB-41921](https://cockroachlabs.atlassian.net/browse/CRDB-41921) Release note (build change): Upgrade to Go 1.23.6 Co-authored-by: Ricky Stewart <[email protected]>
2 parents a2882ae + 4468bfb commit eb62671

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+904
-386
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ build:crosslinuxfips '--workspace_status_command=./build/bazelutil/stamp.sh x86_
8787
build:crosslinuxfips --config=crosslinuxfipsbase
8888
build:crosslinuxfipsbase --platforms=//build/toolchains:cross_linux
8989
build:crosslinuxfipsbase --config=cross
90-
build:crosslinuxfipsbase --@io_bazel_rules_go//go/toolchain:sdk_version=1.22.8fips
90+
build:crosslinuxfipsbase --@io_bazel_rules_go//go/toolchain:sdk_version=1.23.6fips
9191
build:crosswindows '--workspace_status_command=./build/bazelutil/stamp.sh x86_64-w64-mingw32'
9292
build:crosswindows --config=crosswindowsbase
9393
build:crosswindowsbase --platforms=//build/toolchains:cross_windows

DEPS.bzl

Lines changed: 127 additions & 57 deletions
Large diffs are not rendered by default.

WORKSPACE

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,15 @@ load(
167167
go_download_sdk(
168168
name = "go_sdk",
169169
sdks = {
170-
"darwin_amd64": ("go1.22.8.darwin-amd64.tar.gz", "7ff85f9ce9d4927fa8ac682f0b38107776d1ccfa801e3069a944bab69e31b453"),
171-
"darwin_arm64": ("go1.22.8.darwin-arm64.tar.gz", "cb3c233b8e889c5f48edaf0be54ce98b287a44de7473de48a1cf6f4598fa7bf1"),
172-
"linux_amd64": ("go1.22.8.linux-amd64.tar.gz", "d5830d065e0650108d429902f0e7e7c0b2514811da0b93270f43633e7a10b18f"),
173-
"linux_arm64": ("go1.22.8.linux-arm64.tar.gz", "209dd81bcf115f338f4c8b378a96455e7fc2aec7a0a6f33d14f22beb81d8b682"),
174-
"linux_s390x": ("go1.22.8.linux-s390x.tar.gz", "65aa1f666781103129779f8658e7076d3f4fbaf245baaeadd15db0bfa72e3e79"),
175-
"windows_amd64": ("go1.22.8.windows-amd64.tar.gz", "d78207ee04c0d4868af32139a1af5035ac7a9f3db107ac32cdfb2b0b5e62a3b6"),
170+
"darwin_amd64": ("go1.23.6.darwin-amd64.tar.gz", "12244e63d27a8b9bbdfce10f65da709677136ce9a2f57e60cffdc926f41609cb"),
171+
"darwin_arm64": ("go1.23.6.darwin-arm64.tar.gz", "bf611f6840b3fed1b9a893e82d46cc953b65b4cc0bc100421de9de975cec9075"),
172+
"linux_amd64": ("go1.23.6.linux-amd64.tar.gz", "bb4c31bf4d57859038933b6dc1a938707a0dd1cd9516ae73ccdc6d746de8cfd9"),
173+
"linux_arm64": ("go1.23.6.linux-arm64.tar.gz", "8c34228e3537549627211c9f24e94b3a4ee34d77a673196dc1e37ba5fc3f242d"),
174+
"linux_s390x": ("go1.23.6.linux-s390x.tar.gz", "5124de418fa16a77583dff2aa3c267afd0e0348b94a3e8350183ae8352bb7858"),
175+
"windows_amd64": ("go1.23.6.windows-amd64.tar.gz", "a643b5f52bf31d7addd81a044e7115f1116291df461f86b7a0210599f22437b8"),
176176
},
177-
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20250214-212839/{}"],
178-
version = "1.22.8",
177+
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20250219-170339/{}"],
178+
version = "1.23.6",
179179
)
180180

181181
# To point to a local SDK path, use the following instead. We'll call the
@@ -654,8 +654,8 @@ go_download_sdk(
654654
# able to provide additional diagnostic information such as the expected version of OpenSSL.
655655
experiments = ["boringcrypto"],
656656
sdks = {
657-
"linux_amd64": ("go1.22.8fips.linux-amd64.tar.gz", "4d9b9c4193a7648472d80b1f571e9c553aa8615fa1369ac5557365ad0f8ca03a"),
657+
"linux_amd64": ("go1.23.6fips.linux-amd64.tar.gz", "6cb9528f849fca5e565b57dd20c17506c33fcb58a8b0a901a77b43277c4aeb0e"),
658658
},
659-
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20250214-212839/{}"],
660-
version = "1.22.8fips",
659+
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20250219-170339/{}"],
660+
version = "1.23.6fips",
661661
)

build/bazelutil/distdir_files.bzl

Lines changed: 33 additions & 26 deletions
Large diffs are not rendered by default.

build/bazelutil/staticcheckanalyzers/def.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ STATICCHECK_CHECKS = [
6565
"//build/bazelutil/staticcheckanalyzers/sa1028",
6666
"//build/bazelutil/staticcheckanalyzers/sa1029",
6767
"//build/bazelutil/staticcheckanalyzers/sa1030",
68+
"//build/bazelutil/staticcheckanalyzers/sa1031",
69+
"//build/bazelutil/staticcheckanalyzers/sa1032",
6870
"//build/bazelutil/staticcheckanalyzers/sa2000",
6971
"//build/bazelutil/staticcheckanalyzers/sa2001",
7072
"//build/bazelutil/staticcheckanalyzers/sa2002",
@@ -101,6 +103,7 @@ STATICCHECK_CHECKS = [
101103
"//build/bazelutil/staticcheckanalyzers/sa4029",
102104
"//build/bazelutil/staticcheckanalyzers/sa4030",
103105
"//build/bazelutil/staticcheckanalyzers/sa4031",
106+
"//build/bazelutil/staticcheckanalyzers/sa4032",
104107
"//build/bazelutil/staticcheckanalyzers/sa5000",
105108
"//build/bazelutil/staticcheckanalyzers/sa5001",
106109
"//build/bazelutil/staticcheckanalyzers/sa5002",
@@ -118,6 +121,7 @@ STATICCHECK_CHECKS = [
118121
"//build/bazelutil/staticcheckanalyzers/sa6002",
119122
"//build/bazelutil/staticcheckanalyzers/sa6003",
120123
"//build/bazelutil/staticcheckanalyzers/sa6005",
124+
"//build/bazelutil/staticcheckanalyzers/sa6006",
121125
"//build/bazelutil/staticcheckanalyzers/sa9001",
122126
"//build/bazelutil/staticcheckanalyzers/sa9002",
123127
"//build/bazelutil/staticcheckanalyzers/sa9003",
@@ -126,6 +130,7 @@ STATICCHECK_CHECKS = [
126130
"//build/bazelutil/staticcheckanalyzers/sa9006",
127131
"//build/bazelutil/staticcheckanalyzers/sa9007",
128132
"//build/bazelutil/staticcheckanalyzers/sa9008",
133+
"//build/bazelutil/staticcheckanalyzers/sa9009",
129134
"//build/bazelutil/staticcheckanalyzers/st1000",
130135
"//build/bazelutil/staticcheckanalyzers/st1001",
131136
"//build/bazelutil/staticcheckanalyzers/st1003",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Code generated by generate-staticcheck; DO NOT EDIT.
2+
3+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
4+
5+
go_library(
6+
name = "sa1031",
7+
srcs = ["analyzer.go"],
8+
importpath = "github.com/cockroachdb/cockroach/build/bazelutil/staticcheckanalyzers/sa1031",
9+
visibility = ["//visibility:public"],
10+
deps = [
11+
"//pkg/testutils/lint/passes/staticcheck",
12+
"@co_honnef_go_tools//staticcheck",
13+
"@org_golang_x_tools//go/analysis",
14+
],
15+
)

build/bazelutil/staticcheckanalyzers/sa1031/analyzer.go

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Code generated by generate-staticcheck; DO NOT EDIT.
2+
3+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
4+
5+
go_library(
6+
name = "sa1032",
7+
srcs = ["analyzer.go"],
8+
importpath = "github.com/cockroachdb/cockroach/build/bazelutil/staticcheckanalyzers/sa1032",
9+
visibility = ["//visibility:public"],
10+
deps = [
11+
"//pkg/testutils/lint/passes/staticcheck",
12+
"@co_honnef_go_tools//staticcheck",
13+
"@org_golang_x_tools//go/analysis",
14+
],
15+
)

build/bazelutil/staticcheckanalyzers/sa1032/analyzer.go

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Code generated by generate-staticcheck; DO NOT EDIT.
2+
3+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
4+
5+
go_library(
6+
name = "sa4032",
7+
srcs = ["analyzer.go"],
8+
importpath = "github.com/cockroachdb/cockroach/build/bazelutil/staticcheckanalyzers/sa4032",
9+
visibility = ["//visibility:public"],
10+
deps = [
11+
"//pkg/testutils/lint/passes/staticcheck",
12+
"@co_honnef_go_tools//staticcheck",
13+
"@org_golang_x_tools//go/analysis",
14+
],
15+
)

build/bazelutil/staticcheckanalyzers/sa4032/analyzer.go

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Code generated by generate-staticcheck; DO NOT EDIT.
2+
3+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
4+
5+
go_library(
6+
name = "sa6006",
7+
srcs = ["analyzer.go"],
8+
importpath = "github.com/cockroachdb/cockroach/build/bazelutil/staticcheckanalyzers/sa6006",
9+
visibility = ["//visibility:public"],
10+
deps = [
11+
"//pkg/testutils/lint/passes/staticcheck",
12+
"@co_honnef_go_tools//staticcheck",
13+
"@org_golang_x_tools//go/analysis",
14+
],
15+
)

build/bazelutil/staticcheckanalyzers/sa6006/analyzer.go

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Code generated by generate-staticcheck; DO NOT EDIT.
2+
3+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
4+
5+
go_library(
6+
name = "sa9009",
7+
srcs = ["analyzer.go"],
8+
importpath = "github.com/cockroachdb/cockroach/build/bazelutil/staticcheckanalyzers/sa9009",
9+
visibility = ["//visibility:public"],
10+
deps = [
11+
"//pkg/testutils/lint/passes/staticcheck",
12+
"@co_honnef_go_tools//staticcheck",
13+
"@org_golang_x_tools//go/analysis",
14+
],
15+
)

build/bazelutil/staticcheckanalyzers/sa9009/analyzer.go

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/bootstrap/bootstrap-debian.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ sudo tar -C /usr --strip-components=1 -zxf /tmp/cmake.tgz && rm /tmp/cmake.tgz
4545

4646
# Install Go.
4747
trap 'rm -f /tmp/go.tgz' EXIT
48-
curl -fsSL https://dl.google.com/go/go1.22.8.linux-amd64.tar.gz >/tmp/go.tgz
48+
curl -fsSL https://dl.google.com/go/go1.23.6.linux-amd64.tar.gz >/tmp/go.tgz
4949
sha256sum -c - <<EOF
50-
5f467d29fc67c7ae6468cb6ad5b047a274bae8180cac5e0b7ddbfeba3e47e18f /tmp/go.tgz
50+
9379441ea310de000f33a4dc767bd966e72ab2826270e038e78b2c53c2e7802d /tmp/go.tgz
5151
EOF
5252
sudo tar -C /usr/local -zxf /tmp/go.tgz && rm /tmp/go.tgz
5353

build/patches/co_honnef_go_tools.patch

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
1-
diff --git a/staticcheck/lint.go b/staticcheck/lint.go
2-
index 85bcb21..9fb4cc0 100644
3-
--- a/staticcheck/lint.go
4-
+++ b/staticcheck/lint.go
5-
@@ -3080,6 +3080,9 @@ func CheckDeprecated(pass *analysis.Pass) (interface{}, error) {
1+
diff --git a/staticcheck/sa1019/sa1019.go b/staticcheck/sa1019/sa1019.go
2+
index 50a40066..c5f9de8b 100644
3+
--- a/staticcheck/sa1019/sa1019.go
4+
+++ b/staticcheck/sa1019/sa1019.go
5+
@@ -56,6 +56,10 @@ func run(pass *analysis.Pass) (interface{}, error) {
66
}
77

88
handleDeprecation := func(depr *deprecated.IsDeprecated, node ast.Node, deprecatedObjName string, pkgPath string, tfn types.Object) {
99
+ if depr == nil && !isStdlibPath(pkgPath) {
1010
+ panic(`Cannot pass nil "depr" object if the deprecated object is not from the standard library`)
1111
+ }
12-
// Note: gopls doesn't correctly run analyzers on
13-
// dependencies, so we'll never be able to find deprecated
14-
// objects in imported code. We've experimented with
15-
@@ -3136,16 +3139,16 @@ func CheckDeprecated(pass *analysis.Pass) (interface{}, error) {
12+
+
13+
std, ok := knowledge.StdlibDeprecations[deprecatedObjName]
14+
if !ok && isStdlibPath(pkgPath) {
15+
// Deprecated object in the standard library, but we don't know the details of the deprecation.
16+
@@ -98,16 +102,16 @@ func run(pass *analysis.Pass) (interface{}, error) {
1617
switch std.AlternativeAvailableSince {
1718
case knowledge.DeprecatedNeverUse:
1819
report.Report(pass, node,
19-
- fmt.Sprintf("%s has been deprecated since Go 1.%d because it shouldn't be used: %s",
20-
- report.Render(pass, node), std.DeprecatedSince, depr.Msg))
21-
+ fmt.Sprintf("%s has been deprecated since Go 1.%d because it shouldn't be used",
22-
+ report.Render(pass, node), std.DeprecatedSince))
20+
- fmt.Sprintf("%s has been deprecated since %s because it shouldn't be used: %s",
21+
- report.Render(pass, node), formatGoVersion(std.DeprecatedSince), depr.Msg))
22+
+ fmt.Sprintf("%s has been deprecated since %s because it shouldn't be used",
23+
+ report.Render(pass, node), formatGoVersion(std.DeprecatedSince)))
2324
case std.DeprecatedSince, knowledge.DeprecatedUseNoLonger:
2425
report.Report(pass, node,
25-
- fmt.Sprintf("%s has been deprecated since Go 1.%d: %s",
26-
- report.Render(pass, node), std.DeprecatedSince, depr.Msg))
27-
+ fmt.Sprintf("%s has been deprecated since Go 1.%d",
28-
+ report.Render(pass, node), std.DeprecatedSince))
26+
- fmt.Sprintf("%s has been deprecated since %s: %s",
27+
- report.Render(pass, node), formatGoVersion(std.DeprecatedSince), depr.Msg))
28+
+ fmt.Sprintf("%s has been deprecated since %s",
29+
+ report.Render(pass, node), formatGoVersion(std.DeprecatedSince)))
2930
default:
3031
report.Report(pass, node,
31-
- fmt.Sprintf("%s has been deprecated since Go 1.%d and an alternative has been available since Go 1.%d: %s",
32-
- report.Render(pass, node), std.DeprecatedSince, std.AlternativeAvailableSince, depr.Msg))
33-
+ fmt.Sprintf("%s has been deprecated since Go 1.%d and an alternative has been available since Go 1.%d",
34-
+ report.Render(pass, node), std.DeprecatedSince, std.AlternativeAvailableSince))
32+
- fmt.Sprintf("%s has been deprecated since %s and an alternative has been available since %s: %s",
33+
- report.Render(pass, node), formatGoVersion(std.DeprecatedSince), formatGoVersion(std.AlternativeAvailableSince), depr.Msg))
34+
+ fmt.Sprintf("%s has been deprecated since %s and an alternative has been available since %s",
35+
+ report.Render(pass, node), formatGoVersion(std.DeprecatedSince), formatGoVersion(std.AlternativeAvailableSince)))
3536
}
3637
} else {
3738
report.Report(pass, node, fmt.Sprintf("%s is deprecated: %s", report.Render(pass, node), depr.Msg))
38-
@@ -3185,6 +3188,8 @@ func CheckDeprecated(pass *analysis.Pass) (interface{}, error) {
39+
@@ -167,7 +171,10 @@ func run(pass *analysis.Pass) (interface{}, error) {
3940

4041
if depr, ok := deprs.Objects[obj]; ok {
4142
handleDeprecation(depr, sel, code.SelectorName(pass, sel), obj.Pkg().Path(), tfn)
4243
+ } else if _, ok := knowledge.StdlibDeprecations[code.SelectorName(pass, sel)]; ok {
4344
+ handleDeprecation(nil, sel, code.SelectorName(pass, sel), obj.Pkg().Path(), tfn)
4445
}
46+
+
4547
return true
4648
}
47-
@@ -3209,6 +3214,8 @@ func CheckDeprecated(pass *analysis.Pass) (interface{}, error) {
49+
50+
@@ -204,6 +211,8 @@ func run(pass *analysis.Pass) (interface{}, error) {
4851
}
4952

5053
handleDeprecation(depr, spec.Path, path, path, nil)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
881c7c7293f92d8d5cef477fc5395b72e1558203
1+
a8068ca43c8b4fa775fe43d29073864806bd4b35

0 commit comments

Comments
 (0)