Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
134325: build: upgrade to Go 1.22.8 r=rail a=rickystewart

* [ ] 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`).
* [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: none
Release note: Upgrade to Go 1.22.8

134345: workloadccl: update backup/restore syntax r=msbutler a=kev-cao

The old backup/restore syntax was removed in cockroachdb#133610 and is no longer supported. Some workloads were not fully updated to the new syntax. This patch updates some of the old syntaxes that were missed.

Fixes: cockroachdb#134286

Epic: none

Release note: none

Co-authored-by: Ricky Stewart <[email protected]>
Co-authored-by: Kevin Cao <[email protected]>
  • Loading branch information
3 people committed Nov 6, 2024
3 parents d0ff9c7 + 6805d86 + cf0da47 commit 8c34a77
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -89,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.22.8fips
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
20 changes: 10 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ load(
go_download_sdk(
name = "go_sdk",
sdks = {
"darwin_amd64": ("go1.22.5.darwin-amd64.tar.gz", "0eca73b33e9fc3b8eae28c4873b979f5ebd4b7dc8771b9b13ba2d70517309a4d"),
"darwin_arm64": ("go1.22.5.darwin-arm64.tar.gz", "2d72a9301bf73f5429cbc40ba08b6602b1af91a5d5eed302fef2b92ae53b0b56"),
"linux_amd64": ("go1.22.5.linux-amd64.tar.gz", "477ec7b6f76e6c38d83fbd808af0729299b40a8e99796ac3b2fec50d62e20938"),
"linux_arm64": ("go1.22.5.linux-arm64.tar.gz", "fbaf48b411d434aad694fddc8a036ce7374f2d8459518a25fec4f58f3bca0c20"),
"windows_amd64": ("go1.22.5.windows-amd64.tar.gz", "8fc3ccf439e93521faa0411702ef4e598c80ded514bada5fedc11846c284d3d2"),
"darwin_amd64": ("go1.22.8.darwin-amd64.tar.gz", "5d1013d773f76c3cdc974b9afc20033595a2a334774e453be725e7c058e370be"),
"darwin_arm64": ("go1.22.8.darwin-arm64.tar.gz", "304a9d6bfcc5999d47b06f44f79c650173e078251a7adcdb46ba908b22bc4209"),
"linux_amd64": ("go1.22.8.linux-amd64.tar.gz", "ccc2e994241e6677a07e36aea2b1b3ca942fda2aafeedea6ada47e0e9f566f7b"),
"linux_arm64": ("go1.22.8.linux-arm64.tar.gz", "0c49cab48ff13355d346bc8aee5960491c5489120eb7bcd424dab5d341fb12c6"),
"windows_amd64": ("go1.22.8.windows-amd64.tar.gz", "a09ee8a15eae361f673e88bf645c4af8e119ddf9d48d4d9104802bece3818216"),
},
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/{}"],
version = "1.22.5",
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20241105-184020/{}"],
version = "1.22.8",
)

# To point to a local SDK path, use the following instead. We'll call the
Expand Down Expand Up @@ -654,8 +654,8 @@ go_download_sdk(
# able to provide additional diagnostic information such as the expected version of OpenSSL.
experiments = ["boringcrypto"],
sdks = {
"linux_amd64": ("go1.22.5fips.linux-amd64.tar.gz", "d2a40c2e78e2cf1560cafa304593e194e094c3e4dbd404666dda9cf5cc12b7f1"),
"linux_amd64": ("go1.22.8fips.linux-amd64.tar.gz", "c6b2028471b77f106f6989b098ef9f31d7c17e964c742f1e38445d364d632784"),
},
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/{}"],
version = "1.22.5fips",
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20241105-184020/{}"],
version = "1.22.8fips",
)
12 changes: 6 additions & 6 deletions build/bazelutil/distdir_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1228,12 +1228,12 @@ DISTDIR_FILES = {
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20240419-195217/libproj_foreign.macos.20240419-195217.tar.gz": "4b4dadf30e225693723612ede7fc5138eb1ad1b863db744c52099535dbdc3c00",
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20240419-195217/libproj_foreign.macosarm.20240419-195217.tar.gz": "3e3220bd83009de29185772be26022ae219cb006eae1d8dba87292206ce9f4ea",
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20240419-195217/libproj_foreign.windows.20240419-195217.tar.gz": "8284b57f832ab3c5353860ad715e8844c93bf6822b01cb5108b5b494ea90a2dc",
"https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/go1.22.5.darwin-amd64.tar.gz": "0eca73b33e9fc3b8eae28c4873b979f5ebd4b7dc8771b9b13ba2d70517309a4d",
"https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/go1.22.5.darwin-arm64.tar.gz": "2d72a9301bf73f5429cbc40ba08b6602b1af91a5d5eed302fef2b92ae53b0b56",
"https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/go1.22.5.linux-amd64.tar.gz": "477ec7b6f76e6c38d83fbd808af0729299b40a8e99796ac3b2fec50d62e20938",
"https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/go1.22.5.linux-arm64.tar.gz": "fbaf48b411d434aad694fddc8a036ce7374f2d8459518a25fec4f58f3bca0c20",
"https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/go1.22.5.windows-amd64.tar.gz": "8fc3ccf439e93521faa0411702ef4e598c80ded514bada5fedc11846c284d3d2",
"https://storage.googleapis.com/public-bazel-artifacts/go/20240708-162411/go1.22.5fips.linux-amd64.tar.gz": "d2a40c2e78e2cf1560cafa304593e194e094c3e4dbd404666dda9cf5cc12b7f1",
"https://storage.googleapis.com/public-bazel-artifacts/go/20241105-184020/go1.22.8.darwin-amd64.tar.gz": "5d1013d773f76c3cdc974b9afc20033595a2a334774e453be725e7c058e370be",
"https://storage.googleapis.com/public-bazel-artifacts/go/20241105-184020/go1.22.8.darwin-arm64.tar.gz": "304a9d6bfcc5999d47b06f44f79c650173e078251a7adcdb46ba908b22bc4209",
"https://storage.googleapis.com/public-bazel-artifacts/go/20241105-184020/go1.22.8.linux-amd64.tar.gz": "ccc2e994241e6677a07e36aea2b1b3ca942fda2aafeedea6ada47e0e9f566f7b",
"https://storage.googleapis.com/public-bazel-artifacts/go/20241105-184020/go1.22.8.linux-arm64.tar.gz": "0c49cab48ff13355d346bc8aee5960491c5489120eb7bcd424dab5d341fb12c6",
"https://storage.googleapis.com/public-bazel-artifacts/go/20241105-184020/go1.22.8.windows-amd64.tar.gz": "a09ee8a15eae361f673e88bf645c4af8e119ddf9d48d4d9104802bece3818216",
"https://storage.googleapis.com/public-bazel-artifacts/go/20241105-184020/go1.22.8fips.linux-amd64.tar.gz": "c6b2028471b77f106f6989b098ef9f31d7c17e964c742f1e38445d364d632784",
"https://storage.googleapis.com/public-bazel-artifacts/java/railroad/rr-1.63-java8.zip": "d2791cd7a44ea5be862f33f5a9b3d40aaad9858455828ebade7007ad7113fb41",
"https://storage.googleapis.com/public-bazel-artifacts/js/rules_jest-v0.18.4.tar.gz": "d3bb833f74b8ad054e6bff5e41606ff10a62880cc99e4d480f4bdfa70add1ba7",
"https://storage.googleapis.com/public-bazel-artifacts/js/rules_js-v1.42.3.tar.gz": "2cfb3875e1231cefd3fada6774f2c0c5a99db0070e0e48ea398acbff7c6c765b",
Expand Down
4 changes: 2 additions & 2 deletions build/bootstrap/bootstrap-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ sudo tar -C /usr --strip-components=1 -zxf /tmp/cmake.tgz && rm /tmp/cmake.tgz

# Install Go.
trap 'rm -f /tmp/go.tgz' EXIT
curl -fsSL https://dl.google.com/go/go1.22.5.linux-amd64.tar.gz >/tmp/go.tgz
curl -fsSL https://dl.google.com/go/go1.22.8.linux-amd64.tar.gz >/tmp/go.tgz
sha256sum -c - <<EOF
904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0 /tmp/go.tgz
5f467d29fc67c7ae6468cb6ad5b047a274bae8180cac5e0b7ddbfeba3e47e18f /tmp/go.tgz
EOF
sudo tar -C /usr/local -zxf /tmp/go.tgz && rm /tmp/go.tgz

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
set -xeuo pipefail

GO_FIPS_REPO=https://github.com/golang-fips/go
GO_FIPS_COMMIT=8092b8157908b59e5930a1247b6f41842a25f89e
GO_VERSION=1.22.5
GO_FIPS_COMMIT=fc8a2bd706bcd6b18b260a9aea59cf63884acdeb
GO_VERSION=1.22.8

# Install build dependencies
yum install git golang golang-bin openssl openssl-devel -y
Expand All @@ -25,6 +25,11 @@ cd /workspace
git clone $GO_FIPS_REPO go
cd go
git checkout $GO_FIPS_COMMIT
# Delete a patch that we don't want. This shouldn't be necessary when we upgrade
# to Ubuntu 24.04. Without this removal, attempting to run the binary on our
# current build infrastructure results in the following error:
# version `GLIBC_2.32' not found (required by external/go_sdk_fips/bin/go)
rm ./patches/017-fix-linkage.patch
# Lower the requirements in case we need to bootstrap with an older Go version
sed -i "s/go mod tidy/go mod tidy -go=1.16/g" scripts/create-secondary-patch.sh
./scripts/full-initialize-repo.sh "go$GO_VERSION"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
set -xeuo pipefail

# When updating to a new Go version, update all of these variables.
GOVERS=1.22.5
GOVERS=1.22.8
GOLINK=https://go.dev/dl/go$GOVERS.src.tar.gz
SRCSHASUM=ac9c723f224969aee624bc34fd34c9e13f2a212d75c71c807de644bb46e112f6
SRCSHASUM=df12c23ebf19dea0f4bf46a22cbeda4a3eca6f474f318390ce774974278440b8
# We use this for bootstrapping (this is NOT re-published). Note the version
# matches the version we're publishing, although it doesn't technically have to.
GOLINUXLINK=https://go.dev/dl/go$GOVERS.linux-amd64.tar.gz
LINUXSHASUM=904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0
LINUXSHASUM=5f467d29fc67c7ae6468cb6ad5b047a274bae8180cac5e0b7ddbfeba3e47e18f

apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cockroachdb/cockroach

go 1.22.5
go 1.22.8

// golang.org/x/* packages are maintained and curated by the go project, just
// without the backwards compatibility promises the standard library, and thus
Expand Down
4 changes: 2 additions & 2 deletions pkg/ccl/workloadccl/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func MakeFixture(
for _, t := range gen.Tables() {
t := t
g.Go(func() error {
q := fmt.Sprintf(`BACKUP "%s"."%s" TO $1`, dbName, t.Name)
q := fmt.Sprintf(`BACKUP "%s"."%s" INTO $1`, dbName, t.Name)
output := config.ObjectPathToURI(filepath.Join(fixtureFolder, t.Name))
log.Infof(ctx, "Backing %s up to %q...", t.Name, output)
_, err := sqlDB.Exec(q, output)
Expand Down Expand Up @@ -638,7 +638,7 @@ func RestoreFixture(
table := table
g.GoCtx(func(ctx context.Context) error {
start := timeutil.Now()
restoreStmt := fmt.Sprintf(`RESTORE %s.%s FROM $1 WITH into_db=$2, unsafe_restore_incompatible_version`, genName, table.TableName)
restoreStmt := fmt.Sprintf(`RESTORE %s.%s FROM LATEST IN $1 WITH into_db=$2, unsafe_restore_incompatible_version`, genName, table.TableName)
log.Infof(ctx, "Restoring from %s", table.BackupURI)
var rows, index, tableBytes int64
var discard interface{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/tests/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3767,7 +3767,7 @@ const createMSKTopicBinPath = "/tmp/create-msk-topic"
var setupMskTopicScript = fmt.Sprintf(`
#!/bin/bash
set -e -o pipefail
wget https://go.dev/dl/go1.22.5.linux-amd64.tar.gz -O /tmp/go.tar.gz
wget https://go.dev/dl/go1.22.8.linux-amd64.tar.gz -O /tmp/go.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf /tmp/go.tar.gz
echo export PATH=$PATH:/usr/local/go/bin >> ~/.profile
Expand Down

0 comments on commit 8c34a77

Please sign in to comment.