Skip to content

Commit

Permalink
build: update go to 1.21.5
Browse files Browse the repository at this point in the history
* [ ] 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.
* [ ] 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: None
  • Loading branch information
rail committed Dec 11, 2023
1 parent d5e2918 commit 61bb57e
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,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.21.3fips
build:crosslinuxfipsbase --@io_bazel_rules_go//go/toolchain:sdk_version=1.21.5fips
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
56 changes: 32 additions & 24 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ http_archive(
strip_prefix = "rules_js-1.26.1",
url = "https://storage.googleapis.com/public-bazel-artifacts/js/rules_js-v1.26.1.tar.gz",
)

http_archive(
name = "aspect_rules_ts",
sha256 = "ace5b609603d9b5b875d56c9c07182357c4ee495030f40dcefb10d443ba8c208",
strip_prefix = "rules_ts-1.4.0",
url = "https://storage.googleapis.com/public-bazel-artifacts/js/rules_ts-v1.4.0.tar.gz",
)

# NOTE: aspect_rules_webpack exists for webpack, but it's incompatible with webpack v4.
http_archive(
name = "aspect_rules_jest",
Expand Down Expand Up @@ -163,14 +165,14 @@ load(
go_download_sdk(
name = "go_sdk",
sdks = {
"darwin_amd64": ("go1.21.3.darwin-amd64.tar.gz", "85a9bce961b9bd45d6d67e306c79052f739ea9bda99f234ef7a716129315bfc8"),
"darwin_arm64": ("go1.21.3.darwin-arm64.tar.gz", "52d8a95622bf29bb73aa49af0ff73955e034969dba46c7f439399af7adafc787"),
"linux_amd64": ("go1.21.3.linux-amd64.tar.gz", "3ff4a24c4e64b46a3ade80abdcf34b8c26704799ec2763814e68edd81142df68"),
"linux_arm64": ("go1.21.3.linux-arm64.tar.gz", "29b53edd23dbcc27fc421e9cc83a0cd81f1d5e2bf9d061da6907e8be66fff48f"),
"windows_amd64": ("go1.21.3.windows-amd64.tar.gz", "d025882e7d846d722a90ca66204b561c6650e127e338fdc22e39964995253224"),
"darwin_amd64": ("go1.21.5.darwin-amd64.tar.gz", "6878b009493b8b2e5518b090209f63af478a6bdf889c6db4d3c6b68e43839e8e"),
"darwin_arm64": ("go1.21.5.darwin-arm64.tar.gz", "1f3673055f681982bda589bfb23938cb83bef4030efd3516bed0dc3ebd125f41"),
"linux_amd64": ("go1.21.5.linux-amd64.tar.gz", "78e55b80d0a5ef27e8e0913321cae31ba9509c05ed79c429e489ae3a25c74885"),
"linux_arm64": ("go1.21.5.linux-arm64.tar.gz", "89fe32d10a4a3831154bc740bfbc89405a5a8de0655e0cbe91e5ad952dfd6a52"),
"windows_amd64": ("go1.21.5.windows-amd64.tar.gz", "350b40fb129d0eac7eafd5ea2044c6dd1ce8b5a43572f22ef02b53e3d999f28a"),
},
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231205-160258/{}"],
version = "1.21.3",
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231206-175156/{}"],
version = "1.21.5",
)

# To point to a local SDK path, use the following instead. We'll call the
Expand Down Expand Up @@ -225,35 +227,39 @@ toolchain_dependencies()

# Configure nodeJS.
load("//build:nodejs.bzl", "declare_nodejs_repos")

declare_nodejs_repos()

# NOTE: The version is expected to match up to what version of typescript we
# use for all packages in pkg/ui.
# TODO(ricky): We should add a lint check to ensure it does match.
load("@aspect_rules_ts//ts/private:npm_repositories.bzl", ts_http_archive = "http_archive_version")

ts_http_archive(
name = "npm_typescript",
build_file = "@aspect_rules_ts//ts:BUILD.typescript",
urls = ["https://storage.googleapis.com/cockroach-npm-deps/typescript/-/typescript-{}.tgz"],
version = "5.1.6",
# v5.1.6 isn't known to rules_ts 1.4.0 (nor to any published rules_ts version as-of 7 Aug 2023).
integrity = "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==",
urls = ["https://storage.googleapis.com/cockroach-npm-deps/typescript/-/typescript-{}.tgz"],
version = "5.1.6",
)

# NOTE: The version is expected to match up to what version we use in db-console.
# TODO(ricky): We should add a lint check to ensure it does match.
load("@aspect_rules_js//npm:repositories.bzl", "npm_import")

npm_import(
name = "pnpm",
integrity = "sha512-W6elL7Nww0a/MCICkzpkbxW6f99TQuX4DuJoDjWp39X08PKDkEpg4cgj3d6EtgYADcdQWl/eM8NdlLJVE3RgpA==",
package = "pnpm",
url = "https://storage.googleapis.com/cockroach-npm-deps/pnpm/-/pnpm-8.5.1.tgz",
version = "8.5.1",
# Declare an @pnpm//:pnpm rule that can be called externally.
# Copied from https://github.com/aspect-build/rules_js/blob/14724d9b27b2c45f088aa003c091cbe628108170/npm/private/pnpm_repository.bzl#L27-L30
extra_build_content = "\n".join([
"""load("@aspect_rules_js//js:defs.bzl", "js_binary")""",
"""js_binary(name = "pnpm", entry_point = "package/dist/pnpm.cjs", visibility = ["//visibility:public"])""",
]),
integrity = "sha512-W6elL7Nww0a/MCICkzpkbxW6f99TQuX4DuJoDjWp39X08PKDkEpg4cgj3d6EtgYADcdQWl/eM8NdlLJVE3RgpA==",
package = "pnpm",
url = "https://storage.googleapis.com/cockroach-npm-deps/pnpm/-/pnpm-8.5.1.tgz",
version = "8.5.1",
)

load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
Expand All @@ -265,25 +271,26 @@ load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
npm_translate_lock(
name = "npm",
data = [
"//pkg/ui:pnpm-workspace.yaml",
"//pkg/ui:package.json",
"//pkg/ui:pnpm-workspace.yaml",
"//pkg/ui/patches:[email protected]",
"//pkg/ui/workspaces/db-console/src/js:package.json",
"//pkg/ui/workspaces/db-console:package.json",
"//pkg/ui/workspaces/cluster-ui:package.json",
"//pkg/ui/workspaces/eslint-plugin-crdb:package.json",
"//pkg/ui/workspaces/db-console:package.json",
"//pkg/ui/workspaces/db-console/src/js:package.json",
"//pkg/ui/workspaces/e2e-tests:package.json",
"//pkg/ui/workspaces/eslint-plugin-crdb:package.json",
],
npmrc = "//pkg/ui:.npmrc.bazel",
patch_args = {
"*": ["-p1"]
"*": ["-p1"],
},
npmrc = "//pkg/ui:.npmrc.bazel",
pnpm_lock = "//pkg/ui:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
load("@npm//:repositories.bzl", npm_repositories = "npm_repositories")
npm_repositories()

load("@npm//:repositories.bzl", "npm_repositories")

npm_repositories()

#################################
# end rules_js dependencies #
Expand Down Expand Up @@ -598,6 +605,7 @@ http_archive(

# Cockroach binaries for use by mixed-version logictests.
load("//pkg/sql/logictest:REPOSITORIES.bzl", "cockroach_binaries_for_testing")

cockroach_binaries_for_testing()

load("//build/bazelutil:repositories.bzl", "distdir_repositories")
Expand All @@ -608,8 +616,8 @@ distdir_repositories()
go_download_sdk(
name = "go_sdk_fips",
sdks = {
"linux_amd64": ("go1.21.3fips.linux-amd64.tar.gz", "03a3494f7b9d8a63750f72afd4f398baa723509a3c14dbff888a857ca01f0b5c"),
"linux_amd64": ("go1.21.5fips.linux-amd64.tar.gz", "4368ab9cf7c8d75d6d33927917426d587f5be39fb18a87fbe2d59281a8569819"),
},
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231205-160258/{}"],
version = "1.21.3fips",
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231206-175156/{}"],
version = "1.21.5fips",
)
12 changes: 6 additions & 6 deletions build/bazelutil/distdir_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1188,12 +1188,12 @@ DISTDIR_FILES = {
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20230718-202534/libproj_foreign.macos.20230718-202534.tar.gz": "96771a33542beb72067afcafaeb790134014e56798fa4cbe291894c4ebf8b68d",
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20230718-202534/libproj_foreign.macosarm.20230718-202534.tar.gz": "b2c60ffe1f50c6e81ba906f773b95d3a6699538d57e71749579552f4211a1e3e",
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20230718-202534/libproj_foreign.windows.20230718-202534.tar.gz": "16de1e76ee8de4bd144dc57bfde05385d086943ca1b64cc246055c8b0cd71c65",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231205-160258/go1.21.3.darwin-amd64.tar.gz": "85a9bce961b9bd45d6d67e306c79052f739ea9bda99f234ef7a716129315bfc8",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231205-160258/go1.21.3.darwin-arm64.tar.gz": "52d8a95622bf29bb73aa49af0ff73955e034969dba46c7f439399af7adafc787",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231205-160258/go1.21.3.linux-amd64.tar.gz": "3ff4a24c4e64b46a3ade80abdcf34b8c26704799ec2763814e68edd81142df68",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231205-160258/go1.21.3.linux-arm64.tar.gz": "29b53edd23dbcc27fc421e9cc83a0cd81f1d5e2bf9d061da6907e8be66fff48f",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231205-160258/go1.21.3.windows-amd64.tar.gz": "d025882e7d846d722a90ca66204b561c6650e127e338fdc22e39964995253224",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231205-160258/go1.21.3fips.linux-amd64.tar.gz": "03a3494f7b9d8a63750f72afd4f398baa723509a3c14dbff888a857ca01f0b5c",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231206-175156/go1.21.5.darwin-amd64.tar.gz": "6878b009493b8b2e5518b090209f63af478a6bdf889c6db4d3c6b68e43839e8e",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231206-175156/go1.21.5.darwin-arm64.tar.gz": "1f3673055f681982bda589bfb23938cb83bef4030efd3516bed0dc3ebd125f41",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231206-175156/go1.21.5.linux-amd64.tar.gz": "78e55b80d0a5ef27e8e0913321cae31ba9509c05ed79c429e489ae3a25c74885",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231206-175156/go1.21.5.linux-arm64.tar.gz": "89fe32d10a4a3831154bc740bfbc89405a5a8de0655e0cbe91e5ad952dfd6a52",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231206-175156/go1.21.5.windows-amd64.tar.gz": "350b40fb129d0eac7eafd5ea2044c6dd1ce8b5a43572f22ef02b53e3d999f28a",
"https://storage.googleapis.com/public-bazel-artifacts/go/20231206-175156/go1.21.5fips.linux-amd64.tar.gz": "4368ab9cf7c8d75d6d33927917426d587f5be39fb18a87fbe2d59281a8569819",
"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.26.1.tar.gz": "08061ba5e5e7f4b1074538323576dac819f9337a0c7d75aee43afc8ae7cb6e18",
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 @@ -43,9 +43,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.21.3.linux-amd64.tar.gz > /tmp/go.tgz
curl -fsSL https://dl.google.com/go/go1.21.5.linux-amd64.tar.gz > /tmp/go.tgz
sha256sum -c - <<EOF
1241381b2843fae5a9707eec1f8fb2ef94d827990582c7c7c32f5bdfbfd420c8 /tmp/go.tgz
a2e1d5743e896e5fe1e7d96479c0a769254aed18cf216cf8f4c3a2300a9b3923 /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.21-fips-release
GO_VERSION=1.21.3
GO_VERSION=1.21.5

# 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,13 +3,13 @@
set -xeuo pipefail

# When updating to a new Go version, update all of these variables.
GOVERS=1.21.3
GOVERS=1.21.5
GOLINK=https://go.dev/dl/go$GOVERS.src.tar.gz
SRCSHASUM=186f2b6f8c8b704e696821b09ab2041a5c1ee13dcbc3156a13adcf75931ee488
SRCSHASUM=285cbbdf4b6e6e62ed58f370f3f6d8c30825d6e56c5853c66d3c23bcdb09db19
# 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=1241381b2843fae5a9707eec1f8fb2ef94d827990582c7c7c32f5bdfbfd420c8
LINUXSHASUM=e2bc0b3e4b64111ec117295c088bde5f00eeed1567999ff77bc859d7df70078e

apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
Expand Down

0 comments on commit 61bb57e

Please sign in to comment.