Skip to content

Commit

Permalink
Merge #132111
Browse files Browse the repository at this point in the history
132111: build: upgrade to Go 1.23.2 r=rail,fqazi a=rickystewart

* [x] Adjust the Pebble tests to run in new version.
* [x] Update `build/teamcity/internal/release/build-and-publish-patched-go/impl.sh` with the new version and adjust SHA256 sums as necessary.
* [x] Adjust `GO_VERSION` and `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`).
* [ ] 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)).
* [ ] Replace other mentions of the older version of go (grep for `golang:<old_version>` and `go<old_version>`).

In addition to the upgrade, the following changes had to be made:

* Needed to ugprade `staticcheck` to a version that supported Go 1.23
* Needed to update `errcheck` to a version that supported Go 1.23
* Needed to update `gosnowflake` to work around an issue that manifested
  in the error "failed to parse CA certificate". Updating this to the
  latest version would have resulted in a ton of packages being upgraded
  which would increase the risk of this change proportionally. Instead,
  I opted for a smaller jump plus the addition of a patch that applies
  snowflakedb/gosnowflake@f33dfc7eb567.

Epic: CRDB-41921
Release note (build change): Upgrade to Go 1.23.2

Closes: #129900
Closes: #129897
Closes: #129902

Co-authored-by: Ricky Stewart <[email protected]>
  • Loading branch information
craig[bot] and rickystewart committed Oct 11, 2024
2 parents 7d55a1d + 310e53a commit f31617c
Show file tree
Hide file tree
Showing 104 changed files with 1,343 additions and 738 deletions.
12 changes: 5 additions & 7 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,16 @@ build --flag_alias=cross=//build/toolchains:cross_flag
build --flag_alias=dev=//build/toolchains:dev_flag
build --flag_alias=force_build_cdeps=//build/toolchains:force_build_cdeps_flag
build --flag_alias=heavy=//build/toolchains:heavy_flag
build --flag_alias=lintonbuild=//build/toolchains:nogo_flag
build --flag_alias=nolintonbuild=//build/toolchains:nonogo_explicit_flag

build:crdb_test_off --crdb_test_off
build:cross --cross
build:dev --dev
build:force_build_cdeps --force_build_cdeps
build:heavy --heavy
build:lintonbuild --lintonbuild
build:nolintonbuild --nolintonbuild
build:lintonbuild --run_validations
build:nolintonbuild --norun_validations
# Note: nonogo is classically the name of the nolintonbuild configuration.
build:nonogo --nolintonbuild
build:nonogo --config nolintonbuild
build:test --crdb_test

# Basic settings.
Expand Down Expand Up @@ -65,7 +63,7 @@ test:race --heavy
# CI uses a custom timeout for enormous targets.
test:use_ci_timeouts --test_timeout=60,300,900,900
# CI should always run with `--config=ci`.
build:cibase --lintonbuild
build:cibase --config=lintonbuild
# Set `-test.v` in Go tests.
# Ref: https://github.com/bazelbuild/rules_go/pull/2456
test:cibase --test_env=GO_TEST_WRAP_TESTV=1
Expand All @@ -91,7 +89,7 @@ build:crosslinuxfips '--workspace_status_command=./build/bazelutil/stamp.sh x86_
build:crosslinuxfips --config=crosslinuxfipsbase
build:crosslinuxfipsbase --platforms=//build/toolchains:cross_linux
build:crosslinuxfipsbase --config=cross
build:crosslinuxfipsbase --@io_bazel_rules_go//go/toolchain:sdk_version=1.22.5fips
build:crosslinuxfipsbase --@io_bazel_rules_go//go/toolchain:sdk_version=1.23.2fips
build:crosswindows '--workspace_status_command=./build/bazelutil/stamp.sh x86_64-w64-mingw32'
build:crosswindows --config=crosswindowsbase
build:crosswindowsbase --platforms=//build/toolchains:cross_windows
Expand Down
111 changes: 54 additions & 57 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -152,61 +152,58 @@ nogo(
name = "crdb_nogo",
config = "//build/bazelutil:nogo_config.json",
visibility = ["//visibility:public"],
deps = select({
"//build/toolchains:nogo": [
"@org_golang_x_tools//go/analysis/passes/asmdecl:go_default_library",
"@org_golang_x_tools//go/analysis/passes/assign:go_default_library",
"@org_golang_x_tools//go/analysis/passes/atomic:go_default_library",
"@org_golang_x_tools//go/analysis/passes/atomicalign:go_default_library",
"@org_golang_x_tools//go/analysis/passes/bools:go_default_library",
"@org_golang_x_tools//go/analysis/passes/buildssa:go_default_library",
"@org_golang_x_tools//go/analysis/passes/buildtag:go_default_library",
# TODO(rules_go#2396): pass raw cgo sources to cgocall and re-enable.
# "@org_golang_x_tools//go/analysis/passes/cgocall:go_default_library",
"@org_golang_x_tools//go/analysis/passes/composite:go_default_library",
"@org_golang_x_tools//go/analysis/passes/copylock:go_default_library",
"@org_golang_x_tools//go/analysis/passes/ctrlflow:go_default_library",
"@org_golang_x_tools//go/analysis/passes/deepequalerrors:go_default_library",
"@org_golang_x_tools//go/analysis/passes/errorsas:go_default_library",
"@org_golang_x_tools//go/analysis/passes/findcall:go_default_library",
"@org_golang_x_tools//go/analysis/passes/httpresponse:go_default_library",
"@org_golang_x_tools//go/analysis/passes/ifaceassert:go_default_library",
"@org_golang_x_tools//go/analysis/passes/inspect:go_default_library",
"@org_golang_x_tools//go/analysis/passes/lostcancel:go_default_library",
"@org_golang_x_tools//go/analysis/passes/nilfunc:go_default_library",
"@org_golang_x_tools//go/analysis/passes/nilness:go_default_library",
"@org_golang_x_tools//go/analysis/passes/pkgfact:go_default_library",
"@org_golang_x_tools//go/analysis/passes/printf:go_default_library",
"@org_golang_x_tools//go/analysis/passes/shift:go_default_library",
"@org_golang_x_tools//go/analysis/passes/sortslice:go_default_library",
"@org_golang_x_tools//go/analysis/passes/stdmethods:go_default_library",
"@org_golang_x_tools//go/analysis/passes/stringintconv:go_default_library",
"@org_golang_x_tools//go/analysis/passes/structtag:go_default_library",
"@org_golang_x_tools//go/analysis/passes/testinggoroutine:go_default_library",
"@org_golang_x_tools//go/analysis/passes/tests:go_default_library",
"@org_golang_x_tools//go/analysis/passes/unmarshal:go_default_library",
"@org_golang_x_tools//go/analysis/passes/unreachable:go_default_library",
"@org_golang_x_tools//go/analysis/passes/unsafeptr:go_default_library",
"@org_golang_x_tools//go/analysis/passes/unusedresult:go_default_library",
"//pkg/testutils/lint/passes/deferunlockcheck",
"//pkg/testutils/lint/passes/descriptormarshal",
"//pkg/testutils/lint/passes/errcheck",
"//pkg/testutils/lint/passes/errcmp",
"//pkg/testutils/lint/passes/errwrap",
"//pkg/testutils/lint/passes/fmtsafe",
"//pkg/testutils/lint/passes/grpcclientconnclose",
"//pkg/testutils/lint/passes/grpcstatuswithdetails",
"//pkg/testutils/lint/passes/hash",
"//pkg/testutils/lint/passes/leaktestcall",
"//pkg/testutils/lint/passes/nilness",
"//pkg/testutils/lint/passes/nocopy",
"//pkg/testutils/lint/passes/redactcheck",
"//pkg/testutils/lint/passes/returncheck",
"//pkg/testutils/lint/passes/returnerrcheck",
"//pkg/testutils/lint/passes/shadow",
"//pkg/testutils/lint/passes/timer",
"//pkg/testutils/lint/passes/unconvert",
] + STATICCHECK_CHECKS,
"//conditions:default": [],
}),
deps = [
"@org_golang_x_tools//go/analysis/passes/asmdecl:go_default_library",
"@org_golang_x_tools//go/analysis/passes/assign:go_default_library",
"@org_golang_x_tools//go/analysis/passes/atomic:go_default_library",
"@org_golang_x_tools//go/analysis/passes/atomicalign:go_default_library",
"@org_golang_x_tools//go/analysis/passes/bools:go_default_library",
"@org_golang_x_tools//go/analysis/passes/buildssa:go_default_library",
"@org_golang_x_tools//go/analysis/passes/buildtag:go_default_library",
# TODO(rules_go#2396): pass raw cgo sources to cgocall and re-enable.
# "@org_golang_x_tools//go/analysis/passes/cgocall:go_default_library",
"@org_golang_x_tools//go/analysis/passes/composite:go_default_library",
"@org_golang_x_tools//go/analysis/passes/copylock:go_default_library",
"@org_golang_x_tools//go/analysis/passes/ctrlflow:go_default_library",
"@org_golang_x_tools//go/analysis/passes/deepequalerrors:go_default_library",
"@org_golang_x_tools//go/analysis/passes/errorsas:go_default_library",
"@org_golang_x_tools//go/analysis/passes/findcall:go_default_library",
"@org_golang_x_tools//go/analysis/passes/httpresponse:go_default_library",
"@org_golang_x_tools//go/analysis/passes/ifaceassert:go_default_library",
"@org_golang_x_tools//go/analysis/passes/inspect:go_default_library",
"@org_golang_x_tools//go/analysis/passes/lostcancel:go_default_library",
"@org_golang_x_tools//go/analysis/passes/nilfunc:go_default_library",
"@org_golang_x_tools//go/analysis/passes/nilness:go_default_library",
"@org_golang_x_tools//go/analysis/passes/pkgfact:go_default_library",
"@org_golang_x_tools//go/analysis/passes/printf:go_default_library",
"@org_golang_x_tools//go/analysis/passes/shift:go_default_library",
"@org_golang_x_tools//go/analysis/passes/sortslice:go_default_library",
"@org_golang_x_tools//go/analysis/passes/stdmethods:go_default_library",
"@org_golang_x_tools//go/analysis/passes/stringintconv:go_default_library",
"@org_golang_x_tools//go/analysis/passes/structtag:go_default_library",
"@org_golang_x_tools//go/analysis/passes/testinggoroutine:go_default_library",
"@org_golang_x_tools//go/analysis/passes/tests:go_default_library",
"@org_golang_x_tools//go/analysis/passes/unmarshal:go_default_library",
"@org_golang_x_tools//go/analysis/passes/unreachable:go_default_library",
"@org_golang_x_tools//go/analysis/passes/unsafeptr:go_default_library",
"@org_golang_x_tools//go/analysis/passes/unusedresult:go_default_library",
"//pkg/testutils/lint/passes/deferunlockcheck",
"//pkg/testutils/lint/passes/descriptormarshal",
"//pkg/testutils/lint/passes/errcheck",
"//pkg/testutils/lint/passes/errcmp",
"//pkg/testutils/lint/passes/errwrap",
"//pkg/testutils/lint/passes/fmtsafe",
"//pkg/testutils/lint/passes/grpcclientconnclose",
"//pkg/testutils/lint/passes/grpcstatuswithdetails",
"//pkg/testutils/lint/passes/hash",
"//pkg/testutils/lint/passes/leaktestcall",
"//pkg/testutils/lint/passes/nilness",
"//pkg/testutils/lint/passes/nocopy",
"//pkg/testutils/lint/passes/redactcheck",
"//pkg/testutils/lint/passes/returncheck",
"//pkg/testutils/lint/passes/returnerrcheck",
"//pkg/testutils/lint/passes/shadow",
"//pkg/testutils/lint/passes/timer",
"//pkg/testutils/lint/passes/unconvert",
] + STATICCHECK_CHECKS,
)
Loading

0 comments on commit f31617c

Please sign in to comment.