Skip to content

Commit

Permalink
Merge pull request #112204 from rickystewart/go-upgrade-23.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rickystewart authored Oct 13, 2023
2 parents 539182c + 2e90573 commit 5fca9ee
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,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.19.10fips
build:crosslinuxfipsbase --@io_bazel_rules_go//go/toolchain:sdk_version=1.19.13fips
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
22 changes: 11 additions & 11 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ load(
go_download_sdk(
name = "go_sdk",
sdks = {
"darwin_amd64": ("go1.19.10.darwin-amd64.tar.gz", "48361d76271f9a725942bdc17012ae9fef72359f7b0aa303deb1098e05ef818c"),
"darwin_arm64": ("go1.19.10.darwin-arm64.tar.gz", "7cc8ab7e8e1225b57f44ec8fb26bce70ddea8e076dfdf118ed63fef0c9ff19fb"),
"freebsd_amd64": ("go1.19.10.freebsd-amd64.tar.gz", "0d22265662eaa9b8136223f8ab68f5c06c58c6a6311748fb810e830ebd17cbe2"),
"linux_amd64": ("go1.19.10.linux-amd64.tar.gz", "dfc8a696686d00065ba374209a3a7858926641e0fb55741dd89c357446d69a1e"),
"linux_arm64": ("go1.19.10.linux-arm64.tar.gz", "e36d6ebfce3f244e245a2969f83d26c8dff2bf8b72207822d9d66829cd93d067"),
"windows_amd64": ("go1.19.10.windows-amd64.tar.gz", "dab9df83e0768ff96eddd85a4def88db05ce5a8a0c439abcecd066888906c516"),
"darwin_amd64": ("go1.19.13.darwin-amd64.tar.gz", "98eae563d602271866830199958413a2354a1ea77311b7bd44597f632eab3555"),
"darwin_arm64": ("go1.19.13.darwin-arm64.tar.gz", "74d5abe1ae5bed5556c4a158d0eecd51ac470ff9a920acf14bbfa10e2f7650a8"),
"freebsd_amd64": ("go1.19.13.freebsd-amd64.tar.gz", "97fd4990c5349ab922b9bf3e4c655e899135559ea6ad666d4b3c7a27b1e147a2"),
"linux_amd64": ("go1.19.13.linux-amd64.tar.gz", "3586f3e01bc1946321efbe752df39ad61d9697d59080a656096f0622b2ceb10f"),
"linux_arm64": ("go1.19.13.linux-arm64.tar.gz", "a5cf4bce57682560152f918b587e2af2e2eac499ae4d851d78138269147a11c7"),
"windows_amd64": ("go1.19.13.windows-amd64.tar.gz", "991137d500e0f2feb412bdc7e9c7c0a9e99ff0912b27264894740233bb3086a7"),
},
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20230614-165357/{}"],
version = "1.19.10",
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231011-223645/{}"],
version = "1.19.13",
)

# To point to a local SDK path, use the following instead. We'll call the
Expand Down Expand Up @@ -608,8 +608,8 @@ distdir_repositories()
go_download_sdk(
name = "go_sdk_fips",
sdks = {
"linux_amd64": ("go1.19.10fips.linux-amd64.tar.gz", "c9348fc964fb2893471a6ba91feead205a6f83cd427bc3847949382417005496"),
"linux_amd64": ("go1.19.13fips.linux-amd64.tar.gz", "13e5a63e9b29c178fb003c428c95c0a09e84840caebe95c5406b11a7dc99d7aa"),
},
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20230614-165357/{}"],
version = "1.19.10fips",
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231011-223645/{}"],
version = "1.19.13fips",
)
9 changes: 4 additions & 5 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ process" below):

## Basic Process

**NOTE: This describes how to update the old-fashioned `make`-based builder
image. This is no longer maintained. Wherever it's used, you should stop
using it.**

- Edit `build/builder/Dockerfile` as desired.
- Run `build/builder.sh init` to test -- this will build the image locally.
The result of `init` is a docker image version which you can subsequently
Expand All @@ -107,22 +111,17 @@ Please copy this checklist (based on [Basic Process](#basic-process)) into the r
back to this document and perform these steps:

* [ ] Adjust the Pebble tests to run in new version.
* [ ] Adjust version in Docker image ([source](./builder/Dockerfile)).
* [ ] Adjust version in the TeamCity agent image ([setup script](./packer/teamcity-agent.sh))
* [ ] Rebuild and push the Docker image (following [Basic Process](#basic-process))
* [ ] Update `build/teamcity/internal/release/build-and-publish-patched-go/impl.sh` with the new version and adjust SHA256 sums as necessary.
* [ ] Adjust `GO_VERSION` and `GO_FIPS_COMMIT` for the FIPS Go toolchain ([source](./teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh)).
* [ ] 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.
* [ ] Adjust `--@io_bazel_rules_go//go/toolchain:sdk_version` in [.bazelrc](../.bazelrc).
* [ ] 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.
* [ ] 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.
* [ ] Bump the version in `builder.sh` accordingly ([source](./builder.sh#L6)).
* [ ] Bump the version in `go-version-check.sh` ([source](./go-version-check.sh)), unless bumping to a new patch release.
* [ ] Bump the go version in `go.mod`.
* [ ] 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>`).
* [ ] Update the `builder.dockerImage` parameter in the TeamCity [`Cockroach`](https://teamcity.cockroachdb.com/admin/editProject.html?projectId=Cockroach&tab=projectParams) and [`Internal`](https://teamcity.cockroachdb.com/admin/editProject.html?projectId=Internal&tab=projectParams) projects.
* [ ] Ask the Developer Infrastructure team to deploy new TeamCity agent images according to [packer/README.md](./packer/README.md)

You can test the new builder image in TeamCity by using the custom parameters
Expand Down
14 changes: 7 additions & 7 deletions build/bazelutil/distdir_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1175,13 +1175,13 @@ DISTDIR_FILES = {
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20230718-201514/libproj_foreign.macos.20230718-201514.tar.gz": "a3480b7bf2062b310e91bc8b65b2c67cd5f948857efc9bb3c574e35e6a997cf5",
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20230718-201514/libproj_foreign.macosarm.20230718-201514.tar.gz": "09848d2e4efff4b3984a733a5d913687c6c886b28b059a33be778802b9694675",
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20230718-201514/libproj_foreign.windows.20230718-201514.tar.gz": "3b8be5bf316c21860b0bb9d2a11100b98107d43594629029e2d254cfe8d8772d",
"https://storage.googleapis.com/public-bazel-artifacts/go/20230614-165357/go1.19.10.darwin-amd64.tar.gz": "48361d76271f9a725942bdc17012ae9fef72359f7b0aa303deb1098e05ef818c",
"https://storage.googleapis.com/public-bazel-artifacts/go/20230614-165357/go1.19.10.darwin-arm64.tar.gz": "7cc8ab7e8e1225b57f44ec8fb26bce70ddea8e076dfdf118ed63fef0c9ff19fb",
"https://storage.googleapis.com/public-bazel-artifacts/go/20230614-165357/go1.19.10.freebsd-amd64.tar.gz": "0d22265662eaa9b8136223f8ab68f5c06c58c6a6311748fb810e830ebd17cbe2",
"https://storage.googleapis.com/public-bazel-artifacts/go/20230614-165357/go1.19.10.linux-amd64.tar.gz": "dfc8a696686d00065ba374209a3a7858926641e0fb55741dd89c357446d69a1e",
"https://storage.googleapis.com/public-bazel-artifacts/go/20230614-165357/go1.19.10.linux-arm64.tar.gz": "e36d6ebfce3f244e245a2969f83d26c8dff2bf8b72207822d9d66829cd93d067",
"https://storage.googleapis.com/public-bazel-artifacts/go/20230614-165357/go1.19.10.windows-amd64.tar.gz": "dab9df83e0768ff96eddd85a4def88db05ce5a8a0c439abcecd066888906c516",
"https://storage.googleapis.com/public-bazel-artifacts/go/20230614-165357/go1.19.10fips.linux-amd64.tar.gz": "c9348fc964fb2893471a6ba91feead205a6f83cd427bc3847949382417005496",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-223645/go1.19.13.darwin-amd64.tar.gz": "98eae563d602271866830199958413a2354a1ea77311b7bd44597f632eab3555",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-223645/go1.19.13.darwin-arm64.tar.gz": "74d5abe1ae5bed5556c4a158d0eecd51ac470ff9a920acf14bbfa10e2f7650a8",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-223645/go1.19.13.freebsd-amd64.tar.gz": "97fd4990c5349ab922b9bf3e4c655e899135559ea6ad666d4b3c7a27b1e147a2",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-223645/go1.19.13.linux-amd64.tar.gz": "3586f3e01bc1946321efbe752df39ad61d9697d59080a656096f0622b2ceb10f",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-223645/go1.19.13.linux-arm64.tar.gz": "a5cf4bce57682560152f918b587e2af2e2eac499ae4d851d78138269147a11c7",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-223645/go1.19.13.windows-amd64.tar.gz": "991137d500e0f2feb412bdc7e9c7c0a9e99ff0912b27264894740233bb3086a7",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231011-223645/go1.19.13fips.linux-amd64.tar.gz": "13e5a63e9b29c178fb003c428c95c0a09e84840caebe95c5406b11a7dc99d7aa",
"https://storage.googleapis.com/public-bazel-artifacts/gomod/github.com/bazelbuild/buildtools/v0.0.0-20200718160251-b1667ff58f71/buildtools-v0.0.0-20200718160251-b1667ff58f71.tar.gz": "a9ef5103739dfb5ed2a5b47ab1654842a89695812e4af09e57d7015a5caf97e0",
"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",
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 @@ -45,9 +45,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.19.10.linux-amd64.tar.gz > /tmp/go.tgz
curl -fsSL https://dl.google.com/go/go1.19.13.linux-amd64.tar.gz > /tmp/go.tgz
sha256sum -c - <<EOF
8b045a483d3895c6edba2e90a9189262876190dbbd21756870cdd63821810677 /tmp/go.tgz
4643d4c29c55f53fa0349367d7f1bb5ca554ea6ef528c146825b0f8464e2e668 /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 @@ -5,7 +5,7 @@ set -xeuo pipefail
# TODO: We may want to fork this repo and keep it up to date.
GO_FIPS_REPO=https://github.com/golang-fips/go
GO_FIPS_COMMIT=go1.19-fips-release
GO_VERSION=1.19.10
GO_VERSION=1.19.13

# Install build dependencies
yum install git golang golang-bin openssl openssl-devel -y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
set -xeuo pipefail

# When updating to a new Go version, update all of these variables.
GOVERS=1.19.10
GOVERS=1.19.13
GOLINK=https://go.dev/dl/go$GOVERS.src.tar.gz
SRCSHASUM=13755bcce529747d5f2930dee034730c86d02bd3e521ab3e2bbede548d3b953f
SRCSHASUM=ccf36b53fb0024a017353c3ddb22c1f00bc7a8073c6aac79042da24ee34434d3
# We mirror the upstream freebsd because we don't have a cross-compiler targeting it.
GOFREEBSDLINK=https://go.dev/dl/go$GOVERS.freebsd-amd64.tar.gz
FREEBSDSHASUM=0d22265662eaa9b8136223f8ab68f5c06c58c6a6311748fb810e830ebd17cbe2
FREEBSDSHASUM=97fd4990c5349ab922b9bf3e4c655e899135559ea6ad666d4b3c7a27b1e147a2

apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/roachtest/tests/go_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ func installGolang(
}

if err := repeatRunE(
ctx, t, c, node, "download go", `curl -fsSL https://dl.google.com/go/go1.19.10.linux-amd64.tar.gz > /tmp/go.tgz`,
ctx, t, c, node, "download go", `curl -fsSL https://dl.google.com/go/go1.19.13.linux-amd64.tar.gz > /tmp/go.tgz`,
); err != nil {
t.Fatal(err)
}
if err := repeatRunE(
ctx, t, c, node, "verify tarball", `sha256sum -c - <<EOF
8b045a483d3895c6edba2e90a9189262876190dbbd21756870cdd63821810677 /tmp/go.tgz
4643d4c29c55f53fa0349367d7f1bb5ca554ea6ef528c146825b0f8464e2e668 /tmp/go.tgz
EOF`,
); err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 5fca9ee

Please sign in to comment.