From 75248e881a54408b0f299083a3c999bfcb05d664 Mon Sep 17 00:00:00 2001 From: Ricky Stewart Date: Mon, 23 Oct 2023 11:23:15 -0500 Subject: [PATCH 1/5] build: remove specific support for FreeBSD This is an unsupported configuration. Epic: none Release note: None --- WORKSPACE | 7 --- build/bazelutil/distdir_files.bzl | 1 - build/nodejs.bzl | 8 --- build/patches/aspect_bazel_lib.patch | 62 ------------------- .../build-and-publish-patched-go/impl.sh | 6 -- build/toolchains/BUILD.bazel | 14 ----- pkg/cmd/dev/doctor.go | 28 --------- pkg/util/grunning/BUILD.bazel | 8 +++ pkg/util/grunning/disabled.go | 4 +- pkg/util/grunning/disabled_test.go | 4 +- pkg/util/grunning/enabled.go | 3 +- pkg/util/grunning/enabled_test.go | 3 +- pkg/util/grunning/grunning.go | 5 +- 13 files changed, 15 insertions(+), 138 deletions(-) delete mode 100644 build/patches/aspect_bazel_lib.patch diff --git a/WORKSPACE b/WORKSPACE index b2550f3e6d87..ba4a39955852 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -165,7 +165,6 @@ go_download_sdk( sdks = { "darwin_amd64": ("go1.20.10.darwin-amd64.tar.gz", "9f554a97818568cdcb58b8860ebdc0d25cbe7a6441e7f8fc9612c00330d3f145"), "darwin_arm64": ("go1.20.10.darwin-arm64.tar.gz", "4920629c1e65cf28f4fb8c74d7b2f90a1bb6333df60d2fd7e756a3436209f004"), - "freebsd_amd64": ("go1.20.10.freebsd-amd64.tar.gz", "e337b8e645e37f52d04e5f91352b929e05fd74d960b2a1c8e78977e4777c4ffa"), "linux_amd64": ("go1.20.10.linux-amd64.tar.gz", "cb95ca59edf9d15d6e7949395756f78542383b612abced2565ad2349213a36e3"), "linux_arm64": ("go1.20.10.linux-arm64.tar.gz", "5fa30f7c4f39c96d31756d7eab6c560ac129caf0462512c9f1fc2afa00570778"), "windows_amd64": ("go1.20.10.windows-amd64.tar.gz", "d84f04cf636033073c114ac5c51f38d948bf21bb53b3aa9442d362e970f94b32"), @@ -214,8 +213,6 @@ http_archive( http_archive( name = "aspect_bazel_lib", - patch_args = ["-p1"], - patches = ["//build/patches:aspect_bazel_lib.patch"], sha256 = "0da75299c5a52737b2ac39458398b3f256e41a1a6748e5457ceb3a6225269485", strip_prefix = "bazel-lib-1.31.2", url = "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel-lib-v1.31.2.tar.gz", @@ -549,22 +546,18 @@ register_toolchains( "//build/toolchains:cross_arm64_windows_toolchain", "//build/toolchains:cross_arm64_macos_toolchain", "//build/toolchains:cross_arm64_macos_arm_toolchain", - "//build/toolchains:node_freebsd_toolchain", "@copy_directory_toolchains//:darwin_amd64_toolchain", "@copy_directory_toolchains//:darwin_arm64_toolchain", - "@copy_directory_toolchains//:freebsd_amd64_toolchain", "@copy_directory_toolchains//:linux_amd64_toolchain", "@copy_directory_toolchains//:linux_arm64_toolchain", "@copy_directory_toolchains//:windows_amd64_toolchain", "@copy_to_directory_toolchains//:darwin_amd64_toolchain", "@copy_to_directory_toolchains//:darwin_arm64_toolchain", - "@copy_to_directory_toolchains//:freebsd_amd64_toolchain", "@copy_to_directory_toolchains//:linux_amd64_toolchain", "@copy_to_directory_toolchains//:linux_arm64_toolchain", "@copy_to_directory_toolchains//:windows_amd64_toolchain", "@nodejs_toolchains//:darwin_amd64_toolchain", "@nodejs_toolchains//:darwin_arm64_toolchain", - # NB: The freebsd node toolchain is above as //build/toolchains:node_freebsd_toolchain "@nodejs_toolchains//:linux_amd64_toolchain", "@nodejs_toolchains//:linux_arm64_toolchain", "@nodejs_toolchains//:windows_amd64_toolchain", diff --git a/build/bazelutil/distdir_files.bzl b/build/bazelutil/distdir_files.bzl index 73eca092026c..e2c5b794905b 100644 --- a/build/bazelutil/distdir_files.bzl +++ b/build/bazelutil/distdir_files.bzl @@ -1190,7 +1190,6 @@ DISTDIR_FILES = { "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/20231011-170949/go1.20.10.darwin-amd64.tar.gz": "9f554a97818568cdcb58b8860ebdc0d25cbe7a6441e7f8fc9612c00330d3f145", "https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.darwin-arm64.tar.gz": "4920629c1e65cf28f4fb8c74d7b2f90a1bb6333df60d2fd7e756a3436209f004", - "https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.freebsd-amd64.tar.gz": "e337b8e645e37f52d04e5f91352b929e05fd74d960b2a1c8e78977e4777c4ffa", "https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.linux-amd64.tar.gz": "cb95ca59edf9d15d6e7949395756f78542383b612abced2565ad2349213a36e3", "https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.linux-arm64.tar.gz": "5fa30f7c4f39c96d31756d7eab6c560ac129caf0462512c9f1fc2afa00570778", "https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.windows-amd64.tar.gz": "d84f04cf636033073c114ac5c51f38d948bf21bb53b3aa9442d362e970f94b32", diff --git a/build/nodejs.bzl b/build/nodejs.bzl index 5271f2f6b635..02ad2279416e 100644 --- a/build/nodejs.bzl +++ b/build/nodejs.bzl @@ -24,7 +24,6 @@ _COPY_DIRECTORY_URL_PREFIX = "https://storage.googleapis.com/public-bazel-artifa _COPY_DIRECTORY_VERSIONS = { "darwin_amd64": "b4d39cd9498b8367ba75ad6c13c7687562dabafbf8c782883815314061f9f043", "darwin_arm64": "1fd4268a242181d7cdbee7f8035b34548b895fd9e438fab05d48e4627e072e53", - "freebsd_amd64": "f874c274202ea767b432f05c62e716f51bd7580ea8efb1349eb29a35375408eb", "linux_amd64": "ce4aaaf41b3b8f9589290d0f3d657400514b7361b9c27f85ac8f966ee4d663b8", "linux_arm64": "51099a643689c2e563ab7cd9e14345dd9670ee4814ac4046501675d402decdf4", "windows_amd64": "6df30928734abb48515ea16d1273a829651adb77b9ecbbe49e02d17cfffab519", @@ -35,7 +34,6 @@ _COPY_TO_DIRECTORY_URL_PREFIX = "https://storage.googleapis.com/public-bazel-art _COPY_TO_DIRECTORY_VERSIONS = { "darwin_amd64": "dadf2fc200a14968664c4b740a76fcee700cb975eb5bfcd3215d253b97a28b23", "darwin_arm64": "97ae06279adf44786c1151aa3e4715474603a4792fa64ec6bccb1b52fa00abc1", - "freebsd_amd64": "195becca548395db4f165e6ee1e3830b375641999f7820a2815ff52f31223981", "linux_amd64": "cfac1d923b7039555265ecf1558200d391ffbed62804a4b8c4510b12a18d6e70", "linux_arm64": "5c4c69f6f20ba0d6646435ad9922d6193871f3b4262cbc65295e4b89ece667a4", "windows_amd64": "2be5d8b2771ffa3922438cda8899f782046633d6d230f744bf63031888a8bf48", @@ -115,12 +113,6 @@ def declare_nodejs_repos(): node_version = _NODE_VERSION, platform = name, ) - # This is used only by rules_nodejs to find the local version of node. - native.new_local_repository( - name = "nodejs_freebsd_amd64", - build_file_content = """exports_files[("bin/node")]""", - path = "/usr/local", - ) nodejs_repo_host_os_alias(name = "nodejs", user_node_repository_name = "nodejs") nodejs_repo_host_os_alias(name = "nodejs_host", user_node_repository_name = "nodejs") toolchains_repo(name = "nodejs_toolchains", user_node_repository_name = "nodejs") diff --git a/build/patches/aspect_bazel_lib.patch b/build/patches/aspect_bazel_lib.patch deleted file mode 100644 index 0abefaa3102b..000000000000 --- a/build/patches/aspect_bazel_lib.patch +++ /dev/null @@ -1,62 +0,0 @@ -diff -urN a/lib/private/copy_directory_toolchain.bzl b/lib/private/copy_directory_toolchain.bzl ---- a/lib/private/copy_directory_toolchain.bzl -+++ b/lib/private/copy_directory_toolchain.bzl -@@ -29,6 +29,12 @@ COPY_DIRECTORY_PLATFORMS = { - "@platforms//cpu:aarch64", - ], - ), -+ "freebsd_amd64": struct( -+ compatible_with = [ -+ "@platforms//os:freebsd", -+ "@platforms//cpu:x86_64", -+ ], -+ ), - "linux_amd64": struct( - compatible_with = [ - "@platforms//os:linux", -diff -urN a/lib/private/copy_to_directory_toolchain.bzl b/lib/private/copy_to_directory_toolchain.bzl ---- a/lib/private/copy_to_directory_toolchain.bzl -+++ b/lib/private/copy_to_directory_toolchain.bzl -@@ -29,6 +29,12 @@ COPY_TO_DIRECTORY_PLATFORMS = { - "@platforms//cpu:aarch64", - ], - ), -+ "freebsd_amd64": struct( -+ compatible_with = [ -+ "@platforms//os:freebsd", -+ "@platforms//cpu:x86_64", -+ ], -+ ), - "linux_amd64": struct( - compatible_with = [ - "@platforms//os:linux", -diff -urN a/lib/private/repo_utils.bzl b/lib/private/repo_utils.bzl ---- a/lib/private/repo_utils.bzl -+++ b/lib/private/repo_utils.bzl -@@ -8,6 +8,10 @@ - """Returns true if the host operating system is Linux""" - return rctx.os.name.lower().startswith("linux") - -+def _is_freebsd(rctx): -+ """Returns true if the host operating system is FreeBSD""" -+ return rctx.os.name.lower().startswith("freebsd") -+ - def _is_windows(rctx): - """Returns true if the host operating system is Windows""" - return rctx.os.name.lower().find("windows") != -1 -@@ -19,12 +23,14 @@ - rctx: rctx - - Returns: -- The string "windows", "linux" or "darwin" that describes the host os -+ The string "windows", "linux", "freebsd" or "darwin" that describes the host os - """ - if _is_darwin(rctx): - return "darwin" - if _is_linux(rctx): - return "linux" -+ if _is_freebsd(rctx): -+ return "freebsd" - if _is_windows(rctx): - return "windows" - fail("unrecognized os") diff --git a/build/teamcity/internal/release/build-and-publish-patched-go/impl.sh b/build/teamcity/internal/release/build-and-publish-patched-go/impl.sh index 7e37dca806c6..0161d37bf548 100755 --- a/build/teamcity/internal/release/build-and-publish-patched-go/impl.sh +++ b/build/teamcity/internal/release/build-and-publish-patched-go/impl.sh @@ -6,9 +6,6 @@ set -xeuo pipefail GOVERS=1.20.10 GOLINK=https://go.dev/dl/go$GOVERS.src.tar.gz SRCSHASUM=72d2f51805c47150066c103754c75fddb2c19d48c9219fa33d1e46696c841dbb -# 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=e337b8e645e37f52d04e5f91352b929e05fd74d960b2a1c8e78977e4777c4ffa apt-get update DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ @@ -27,9 +24,6 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 100 \ --slave /usr/bin/clang++ clang++ /usr/bin/clang++-10 -curl -fsSL $GOFREEBSDLINK -o /artifacts/go$GOVERS.freebsd-amd64.tar.gz -echo "$FREEBSDSHASUM /artifacts/go$GOVERS.freebsd-amd64.tar.gz" | sha256sum -c - - curl -fsSL https://go.dev/dl/go1.20.8.linux-amd64.tar.gz -o golang.tar.gz \ && echo 'cc97c28d9c252fbf28f91950d830201aa403836cbed702a05932e63f7f0c7bc4 golang.tar.gz' | sha256sum -c - \ && rm -rf /usr/local/go && tar -C /usr/local -xzf golang.tar.gz \ diff --git a/build/toolchains/BUILD.bazel b/build/toolchains/BUILD.bazel index ddd7224219a9..a45384c27c8f 100644 --- a/build/toolchains/BUILD.bazel +++ b/build/toolchains/BUILD.bazel @@ -270,20 +270,6 @@ toolchain( toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", ) -toolchain( - name = "node_freebsd_toolchain", - exec_compatible_with = [ - "@platforms//os:freebsd", - ], - toolchain = ":node_freebsd_local_toolchain", - toolchain_type = "@rules_nodejs//nodejs:toolchain_type", -) - -node_toolchain( - name = "node_freebsd_local_toolchain", - target_tool_path = "/usr/local/bin/node", -) - # There are aliases for each of these flags defined in .bazelrc; for example, # --crdb_test instead of --//build/toolchains:crdb_test_flag. # diff --git a/pkg/cmd/dev/doctor.go b/pkg/cmd/dev/doctor.go index 35a3f4d7917e..b0d530b8aa4b 100644 --- a/pkg/cmd/dev/doctor.go +++ b/pkg/cmd/dev/doctor.go @@ -97,34 +97,6 @@ Please perform the following steps: return "" }, }, - { - name: "node", - check: func(d *dev, ctx context.Context, cfg doctorConfig) string { - // Having a pre-installed node is only necessary on freebsd. - if runtime.GOOS != "freebsd" { - return "" - } - _, err := d.exec.CommandContextSilent(ctx, "/usr/local/bin/node", "--version") - if err != nil { - return `/usr/local/bin/node not found. -You can install node with: ` + "`pkg install node`" - } - return "" - }, - autofix: func(d *dev, ctx context.Context, cfg doctorConfig) error { - if !cfg.haveAutofixPermission && cfg.interactive { - response := promptInteractiveInput("Do you want me to run `pkg install node` for you?", "y") - canAutofix, ok := toBoolFuzzy(response) - if ok && canAutofix { - cfg.haveAutofixPermission = true - } - } - if !cfg.haveAutofixPermission { - return fmt.Errorf("do not have permission to install node") - } - return d.exec.CommandContextInheritingStdStreams(ctx, "pkg", "install", "node") - }, - }, { name: "submodules", check: func(d *dev, ctx context.Context, cfg doctorConfig) string { diff --git a/pkg/util/grunning/BUILD.bazel b/pkg/util/grunning/BUILD.bazel index 5c57147fed95..85b240a2286b 100644 --- a/pkg/util/grunning/BUILD.bazel +++ b/pkg/util/grunning/BUILD.bazel @@ -81,18 +81,26 @@ go_test( ], "@io_bazel_rules_go//go/platform:freebsd_386": [ ":grunning", + "//pkg/testutils/skip", + "//pkg/util/syncutil", "@com_github_stretchr_testify//require", ], "@io_bazel_rules_go//go/platform:freebsd_amd64": [ ":grunning", + "//pkg/testutils/skip", + "//pkg/util/syncutil", "@com_github_stretchr_testify//require", ], "@io_bazel_rules_go//go/platform:freebsd_arm": [ ":grunning", + "//pkg/testutils/skip", + "//pkg/util/syncutil", "@com_github_stretchr_testify//require", ], "@io_bazel_rules_go//go/platform:freebsd_arm64": [ ":grunning", + "//pkg/testutils/skip", + "//pkg/util/syncutil", "@com_github_stretchr_testify//require", ], "@io_bazel_rules_go//go/platform:illumos_amd64": [ diff --git a/pkg/util/grunning/disabled.go b/pkg/util/grunning/disabled.go index 7fdc2f0a3b9a..f175eb28af82 100644 --- a/pkg/util/grunning/disabled.go +++ b/pkg/util/grunning/disabled.go @@ -10,8 +10,8 @@ // See grunning.Supported() for an explanation behind this build tag. // -//go:build freebsd || (linux && s390x) || !bazel -// +build freebsd linux,s390x !bazel +//go:build (linux && s390x) || !bazel +// +build linux,s390x !bazel package grunning diff --git a/pkg/util/grunning/disabled_test.go b/pkg/util/grunning/disabled_test.go index 75c6972071f1..d434762c27c3 100644 --- a/pkg/util/grunning/disabled_test.go +++ b/pkg/util/grunning/disabled_test.go @@ -10,8 +10,8 @@ // See grunning.Supported() for an explanation behind this build tag. // -//go:build freebsd || (linux && s390x) || !bazel -// +build freebsd linux,s390x !bazel +//go:build (linux && s390x) || !bazel +// +build linux,s390x !bazel package grunning_test diff --git a/pkg/util/grunning/enabled.go b/pkg/util/grunning/enabled.go index ab12aaefcbe5..f8cd1b5b13db 100644 --- a/pkg/util/grunning/enabled.go +++ b/pkg/util/grunning/enabled.go @@ -10,8 +10,7 @@ // See grunning.Supported() for an explanation behind this build tag. // -//go:build !(freebsd || (linux && s390x) || !bazel) -// +build !freebsd +//go:build !((linux && s390x) || !bazel) // +build !linux !s390x // +build bazel diff --git a/pkg/util/grunning/enabled_test.go b/pkg/util/grunning/enabled_test.go index 2ac57e61bd6b..d12d68228939 100644 --- a/pkg/util/grunning/enabled_test.go +++ b/pkg/util/grunning/enabled_test.go @@ -10,8 +10,7 @@ // See grunning.Supported() for an explanation behind this build tag. // -//go:build !(freebsd || (linux && s390x) || !bazel) -// +build !freebsd +//go:build !((linux && s390x) || !bazel) // +build !linux !s390x // +build bazel diff --git a/pkg/util/grunning/grunning.go b/pkg/util/grunning/grunning.go index 47a8f158738b..91703d93ef73 100644 --- a/pkg/util/grunning/grunning.go +++ b/pkg/util/grunning/grunning.go @@ -50,10 +50,7 @@ func Elapsed(start, end time.Duration) time.Duration { // Supported returns true iff per-goroutine running time is available in this // build. We use a patched Go runtime for all platforms officially supported for -// CRDB when built using Bazel. Some engineers commonly building CRDB also -// happen to use FreeBSD, which we don't use a patched Go for (we don't have -// cross-compilers setup, yet). We use 'freebsd || !bazel' as the build tag to -// exclude unsupported platforms. +// CRDB when built using Bazel. func Supported() bool { return supported() } From 579e4e0973bf41672fff46c8348400b4a73704d7 Mon Sep 17 00:00:00 2001 From: Yevgeniy Miretskiy Date: Wed, 11 Oct 2023 15:00:01 -0400 Subject: [PATCH 2/5] build: upgrade to golang v1.21.3 * [ ] Adjust the Pebble tests to run in new version. * [ ] Adjust version in the TeamCity agent image ([setup script](./packer/teamcity-agent.sh)) * [ ] 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 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:` and `go`). * [ ] Ask the Developer Infrastructure team to deploy new TeamCity agent images according to [packer/README.md](./packer/README.md) Epic: none Release note (general change): Updated Go version to 1.21.3 --- .bazelrc | 2 +- WORKSPACE | 20 +-- build/bazelutil/distdir_files.bzl | 12 +- build/bootstrap/bootstrap-debian.sh | 4 +- .../build-and-publish-patched-go/diff.patch | 120 +++++++++++++++--- .../build-and-publish-patched-go/impl-fips.sh | 6 +- .../build-and-publish-patched-go/impl.sh | 12 +- go.mod | 2 +- go.sum | 15 +++ pkg/acceptance/compose/gss/psql/Dockerfile | 2 +- pkg/cmd/roachprod/docker/Dockerfile | 2 +- pkg/cmd/roachtest/tests/go_helpers.go | 4 +- pkg/col/coldata/batch_test.go | 2 + pkg/col/coldata/bytes.go | 2 + pkg/col/colserde/arrowbatchconverter.go | 11 ++ pkg/security/certs_rotation_test.go | 6 +- pkg/security/certs_test.go | 6 +- .../colexec/colexecwindow/min_max_queue.go | 4 +- pkg/sql/crdb_internal_test.go | 2 +- pkg/util/ctxutil/BUILD.bazel | 5 +- pkg/util/ctxutil/canceler_1_19.go | 28 ---- pkg/util/ctxutil/canceler_1_20.go | 25 +++- .../{link_1_21.go => canceler_1_21.go} | 5 +- ...k_1_21_bazel.go => canceler_1_21_bazel.go} | 13 +- pkg/util/ctxutil/context.go | 8 +- pkg/util/ctxutil/context_test.go | 34 +++-- pkg/util/ctxutil/link_pre_1_21.go | 24 ---- pkg/util/ctxutil/link_shared.go | 22 ---- pkg/util/json/json.go | 4 +- pkg/util/json/parser.go | 1 + pkg/util/log/logcrash/crash_reporting_test.go | 20 +-- pkg/util/parquet/write_functions.go | 1 + 32 files changed, 246 insertions(+), 178 deletions(-) delete mode 100644 pkg/util/ctxutil/canceler_1_19.go rename pkg/util/ctxutil/{link_1_21.go => canceler_1_21.go} (83%) rename pkg/util/ctxutil/{link_1_21_bazel.go => canceler_1_21_bazel.go} (63%) delete mode 100644 pkg/util/ctxutil/link_pre_1_21.go delete mode 100644 pkg/util/ctxutil/link_shared.go diff --git a/.bazelrc b/.bazelrc index 2f1eeb1f96d1..77e71eb0e8c1 100644 --- a/.bazelrc +++ b/.bazelrc @@ -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.20.7fips +build:crosslinuxfipsbase --@io_bazel_rules_go//go/toolchain:sdk_version=1.21.3fips build:crosswindows '--workspace_status_command=./build/bazelutil/stamp.sh x86_64-w64-mingw32' build:crosswindows --config=crosswindowsbase build:crosswindowsbase --platforms=//build/toolchains:cross_windows diff --git a/WORKSPACE b/WORKSPACE index ba4a39955852..cebeaac979a2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -163,14 +163,14 @@ load( go_download_sdk( name = "go_sdk", sdks = { - "darwin_amd64": ("go1.20.10.darwin-amd64.tar.gz", "9f554a97818568cdcb58b8860ebdc0d25cbe7a6441e7f8fc9612c00330d3f145"), - "darwin_arm64": ("go1.20.10.darwin-arm64.tar.gz", "4920629c1e65cf28f4fb8c74d7b2f90a1bb6333df60d2fd7e756a3436209f004"), - "linux_amd64": ("go1.20.10.linux-amd64.tar.gz", "cb95ca59edf9d15d6e7949395756f78542383b612abced2565ad2349213a36e3"), - "linux_arm64": ("go1.20.10.linux-arm64.tar.gz", "5fa30f7c4f39c96d31756d7eab6c560ac129caf0462512c9f1fc2afa00570778"), - "windows_amd64": ("go1.20.10.windows-amd64.tar.gz", "d84f04cf636033073c114ac5c51f38d948bf21bb53b3aa9442d362e970f94b32"), + "darwin_amd64": ("go1.21.3.darwin-amd64.tar.gz", "253d8d4b32a1d7731dff1245f009362858a0c685af8f52b671dd906b2c67d78d"), + "darwin_arm64": ("go1.21.3.darwin-arm64.tar.gz", "877543c11149341e4954cb2e625deb7974e94c3c77f5f71a24d35e54cb54fb05"), + "linux_amd64": ("go1.21.3.linux-amd64.tar.gz", "3b0307b4e91d6b34870ed1d29366aba77cb864dc93b7098cdfb5d4619cb58566"), + "linux_arm64": ("go1.21.3.linux-arm64.tar.gz", "c0d2da5e1b9ff93d0e4262189e59586cc0c17c207578429f716de2d5799ba36a"), + "windows_amd64": ("go1.21.3.windows-amd64.tar.gz", "c0e2957014e72056ed1c2c080d772d7c8e96a3143f228f6b511231fc31c07593"), }, - urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/{}"], - version = "1.20.10", + urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/{}"], + version = "1.21.3", ) # To point to a local SDK path, use the following instead. We'll call the @@ -608,8 +608,8 @@ distdir_repositories() go_download_sdk( name = "go_sdk_fips", sdks = { - "linux_amd64": ("go1.20.7fips.linux-amd64.tar.gz", "e153224976a6cc17cc24128609ef9eaf9fc94b33744ff00646ba36a6f448a074"), + "linux_amd64": ("go1.21.3fips.linux-amd64.tar.gz", "216acc2939bf16748ec240ffe1752b442ec098bd9ac5e12ecd44db4ff77e0ab9"), }, - urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/{}"], - version = "1.20.7fips", + urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/{}"], + version = "1.21.3fips", ) diff --git a/build/bazelutil/distdir_files.bzl b/build/bazelutil/distdir_files.bzl index e2c5b794905b..dcfd62595364 100644 --- a/build/bazelutil/distdir_files.bzl +++ b/build/bazelutil/distdir_files.bzl @@ -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/20231011-170949/go1.20.10.darwin-amd64.tar.gz": "9f554a97818568cdcb58b8860ebdc0d25cbe7a6441e7f8fc9612c00330d3f145", - "https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.darwin-arm64.tar.gz": "4920629c1e65cf28f4fb8c74d7b2f90a1bb6333df60d2fd7e756a3436209f004", - "https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.linux-amd64.tar.gz": "cb95ca59edf9d15d6e7949395756f78542383b612abced2565ad2349213a36e3", - "https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.linux-arm64.tar.gz": "5fa30f7c4f39c96d31756d7eab6c560ac129caf0462512c9f1fc2afa00570778", - "https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.10.windows-amd64.tar.gz": "d84f04cf636033073c114ac5c51f38d948bf21bb53b3aa9442d362e970f94b32", - "https://storage.googleapis.com/public-bazel-artifacts/go/20231011-170949/go1.20.7fips.linux-amd64.tar.gz": "e153224976a6cc17cc24128609ef9eaf9fc94b33744ff00646ba36a6f448a074", + "https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/go1.21.3.darwin-amd64.tar.gz": "253d8d4b32a1d7731dff1245f009362858a0c685af8f52b671dd906b2c67d78d", + "https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/go1.21.3.darwin-arm64.tar.gz": "877543c11149341e4954cb2e625deb7974e94c3c77f5f71a24d35e54cb54fb05", + "https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/go1.21.3.linux-amd64.tar.gz": "3b0307b4e91d6b34870ed1d29366aba77cb864dc93b7098cdfb5d4619cb58566", + "https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/go1.21.3.linux-arm64.tar.gz": "c0d2da5e1b9ff93d0e4262189e59586cc0c17c207578429f716de2d5799ba36a", + "https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/go1.21.3.windows-amd64.tar.gz": "c0e2957014e72056ed1c2c080d772d7c8e96a3143f228f6b511231fc31c07593", + "https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/go1.21.3fips.linux-amd64.tar.gz": "216acc2939bf16748ec240ffe1752b442ec098bd9ac5e12ecd44db4ff77e0ab9", "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", diff --git a/build/bootstrap/bootstrap-debian.sh b/build/bootstrap/bootstrap-debian.sh index c300f7095067..ed089db579f5 100755 --- a/build/bootstrap/bootstrap-debian.sh +++ b/build/bootstrap/bootstrap-debian.sh @@ -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.20.10.linux-amd64.tar.gz > /tmp/go.tgz +curl -fsSL https://dl.google.com/go/go1.21.3.linux-amd64.tar.gz > /tmp/go.tgz sha256sum -c - < 0 { // Flush assist credit to the global pool. This gives diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go -index 9381d1e3f7..8182f8e9bc 100644 +index f4c76abd1c..57672bd8c5 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go -@@ -474,7 +474,6 @@ type g struct { - traceseq uint64 // trace event sequencer - tracelastp puintptr // last P emitted an event for this goroutine - lockedm muintptr -- sig uint32 - writebuf []byte - sigcode0 uintptr - sigcode1 uintptr -@@ -488,6 +487,9 @@ type g struct { - labels unsafe.Pointer // profiler labels - timer *timer // cached timer for time.Sleep - selectDone atomic.Uint32 // are we participating in a select and did someone win the race? -+ sig uint32 -+ lastsched int64 // timestamp when the G last started running -+ runningnanos int64 // wall time spent in the running state +@@ -477,7 +477,6 @@ type g struct { + trackingStamp int64 // timestamp of when the G last started being tracked + runnableTime int64 // the amount of time spent runnable, cleared when running, only used when tracking + lockedm muintptr +- sig uint32 + writebuf []byte + sigcode0 uintptr + sigcode1 uintptr +@@ -492,6 +491,9 @@ type g struct { + labels unsafe.Pointer // profiler labels + timer *timer // cached timer for time.Sleep + selectDone atomic.Uint32 // are we participating in a select and did someone win the race? ++ sig uint32 ++ lastsched int64 // timestamp when the G last started running ++ runningnanos int64 // wall time spent in the running state // goroutineProfiled indicates the status of this goroutine's stack for the // current in-progress goroutine profile diff --git a/src/runtime/sizeof_test.go b/src/runtime/sizeof_test.go -index 9ce0a3afcd..bfb5d6e33e 100644 +index fb9195481a..55e37287c2 100644 --- a/src/runtime/sizeof_test.go +++ b/src/runtime/sizeof_test.go -@@ -21,7 +21,7 @@ func TestSizeof(t *testing.T) { +@@ -21,6 +21,6 @@ func TestSizeof(t *testing.T) { _32bit uintptr // size on 32bit platforms _64bit uintptr // size on 64bit platforms }{ -- {runtime.G{}, 240, 392}, // g, but exported for testing -+ {runtime.G{}, 248, 400}, // g, but exported for testing +- {runtime.G{}, 252, 408}, // g, but exported for testing ++ {runtime.G{}, 260, 416}, // g, but exported for testing {runtime.Sudog{}, 56, 88}, // sudog, but exported for testing } +diff -ru a/src/context/context.go b/src/context/context.go +--- a/src/context/context.go ++++ b/src/context/context.go +@@ -472,17 +472,7 @@ + if p, ok := parentCancelCtx(parent); ok { + // parent is a *cancelCtx, or derives from one. +- p.mu.Lock() +- if p.err != nil { +- // parent has already been canceled +- child.cancel(false, p.err, p.cause) +- } else { +- if p.children == nil { +- p.children = make(map[canceler]struct{}) +- } +- p.children[child] = struct{}{} +- } +- p.mu.Unlock() ++ p.addChild(child) + return + } + +@@ -510,6 +500,22 @@ + }() + } + ++// addChild adds child to the list of children. ++// NB: CockroachDB runtime patch. ++func (c *cancelCtx) addChild(child canceler) { ++ c.mu.Lock() ++ if c.err != nil { ++ // parent has already been canceled ++ child.cancel(false, c.err, c.cause) ++ } else { ++ if c.children == nil { ++ c.children = make(map[canceler]struct{}) ++ } ++ c.children[child] = struct{}{} ++ } ++ c.mu.Unlock() ++} ++ + type stringer interface { + String() string + } +@@ -781,5 +787,35 @@ + default: + return c.Value(key) + } ++ } ++} ++ ++// CockroachDB runtime patch. ++// cancelerAdapter invokes f when cancel context completes. ++type cancelerAdapter struct { ++ *cancelCtx ++ f func() ++} ++ ++func (c *cancelerAdapter) cancel(removeFromParent bool, err, cause error) { ++ if removeFromParent { ++ removeChild(c.cancelCtx, c) + } ++ c.f() + } ++ ++// PropagateCancel arranges for f to be invoked when parent is done. ++// Parent must be one of the cancelable contexts. ++// Returns true if cancellation will be propagated, false if the parent ++// is not cancelable. ++// This is similar to AfterFunc(), but does not spin up goroutine, and instead ++// invokes f on whatever goroutine completed parent context. ++func PropagateCancel(parent Context, f func()) bool { ++ p, ok := parent.Value(&cancelCtxKey).(*cancelCtx) ++ if !ok { ++ return false ++ } ++ a := cancelerAdapter{cancelCtx: p, f: f} ++ p.addChild(&a) ++ return true ++} diff --git a/build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh b/build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh index 778f3e6c77bd..4ed8f5d1a26a 100755 --- a/build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh +++ b/build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh @@ -4,8 +4,8 @@ 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.20-fips-release -GO_VERSION=1.20.7 +GO_FIPS_COMMIT=go1.21-fips-release +GO_VERSION=1.21.3 # Install build dependencies yum install git golang golang-bin openssl openssl-devel -y @@ -27,7 +27,7 @@ cd go/src # Apply the CRL patch patch -p2 < /bootstrap/diff.patch # add a special version modifier so we can explicitly use it in bazel -sed -i 's/$/fips/' ../VERSION +sed -i '1 s/$/fips/' ../VERSION ./make.bash -v cd ../.. GOVERS=$(go/bin/go env GOVERSION) diff --git a/build/teamcity/internal/release/build-and-publish-patched-go/impl.sh b/build/teamcity/internal/release/build-and-publish-patched-go/impl.sh index 0161d37bf548..360cc3fae28c 100755 --- a/build/teamcity/internal/release/build-and-publish-patched-go/impl.sh +++ b/build/teamcity/internal/release/build-and-publish-patched-go/impl.sh @@ -3,9 +3,13 @@ set -xeuo pipefail # When updating to a new Go version, update all of these variables. -GOVERS=1.20.10 +GOVERS=1.21.3 GOLINK=https://go.dev/dl/go$GOVERS.src.tar.gz -SRCSHASUM=72d2f51805c47150066c103754c75fddb2c19d48c9219fa33d1e46696c841dbb +SRCSHASUM=186f2b6f8c8b704e696821b09ab2041a5c1ee13dcbc3156a13adcf75931ee488 +# 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 apt-get update DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ @@ -24,8 +28,8 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 100 \ --slave /usr/bin/clang++ clang++ /usr/bin/clang++-10 -curl -fsSL https://go.dev/dl/go1.20.8.linux-amd64.tar.gz -o golang.tar.gz \ - && echo 'cc97c28d9c252fbf28f91950d830201aa403836cbed702a05932e63f7f0c7bc4 golang.tar.gz' | sha256sum -c - \ +curl -fsSL $GOLINUXLINK -o golang.tar.gz \ + && echo "$LINUXSHASUM golang.tar.gz" | sha256sum -c - \ && rm -rf /usr/local/go && tar -C /usr/local -xzf golang.tar.gz \ && rm golang.tar.gz diff --git a/go.mod b/go.mod index 13a21e1f2103..7a8193520356 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/cockroachdb/cockroach -go 1.20 +go 1.21 // The following dependencies are key infrastructure dependencies and // should be updated as their own commit (i.e. not bundled with a dep diff --git a/go.sum b/go.sum index 2c1d71bfa364..2773c8ae7240 100644 --- a/go.sum +++ b/go.sum @@ -243,6 +243,7 @@ github.com/Shopify/sarama v1.38.1/go.mod h1:iwv9a67Ha8VNa+TifujYoWGxWnu2kNVAQdSd github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/Shopify/toxiproxy/v2 v2.5.0 h1:i4LPT+qrSlKNtQf5QliVjdP08GyAH8+BUIc9gT0eahc= +github.com/Shopify/toxiproxy/v2 v2.5.0/go.mod h1:yhM2epWtAmel9CB8r2+L+PCmhH6yH2pITaPAo7jxJl0= github.com/TomiHiltunen/geohash-golang v0.0.0-20150112065804-b3e4e625abfb h1:wumPkzt4zaxO4rHPBrjDK8iZMR41C1qs7njNqlacwQg= github.com/TomiHiltunen/geohash-golang v0.0.0-20150112065804-b3e4e625abfb/go.mod h1:QiYsIBRQEO+Z4Rz7GoI+dsHVneZNONvhczuA+llOZNM= github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM= @@ -266,6 +267,7 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 h1:Kk6a4nehpJ3UuJRqlA3JxYxBZEqCeOmATOvrbT4p9RA= @@ -813,6 +815,7 @@ github.com/go-chi/chi v4.1.0+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxm github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= @@ -1155,6 +1158,7 @@ github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIG github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181127221834-b4f47329b966/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -2314,6 +2318,7 @@ github.com/z-division/go-zookeeper v0.0.0-20190128072838-6d7457066b9b/go.mod h1: github.com/zabawaba99/go-gitignore v0.0.0-20200117185801-39e6bddfb292 h1:vpcCVk+pSR/6zcurmlGFD3jC5I/7RMl+GwGAPLxvX18= github.com/zabawaba99/go-gitignore v0.0.0-20200117185801-39e6bddfb292/go.mod h1:qcqv8IHwbR0JmjY1LZy4PeytlwxDPn1vUkjX7Wq0VaY= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= +github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= @@ -2917,6 +2922,7 @@ gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= +gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= @@ -3096,6 +3102,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -3229,6 +3236,7 @@ modernc.org/cc/v3 v3.35.18/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g modernc.org/cc/v3 v3.35.20/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= modernc.org/cc/v3 v3.35.22/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= modernc.org/cc/v3 v3.36.3 h1:uISP3F66UlixxWEcKuIWERa4TwrZENHSL8tWxZz8bHg= +modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= modernc.org/ccgo/v3 v3.9.5/go.mod h1:umuo2EP2oDSBnD3ckjaVUXMrmeAw8C8OSICVa0iFf60= modernc.org/ccgo/v3 v3.10.0/go.mod h1:c0yBmkRFi7uW4J7fwx/JiijwOjeAeR2NoSaRVFPmjMw= modernc.org/ccgo/v3 v3.11.0/go.mod h1:dGNposbDp9TOZ/1KBxghxtUp/bzErD0/0QW4hhSaBMI= @@ -3273,6 +3281,7 @@ modernc.org/ccgo/v3 v3.15.10/go.mod h1:wQKxoFn0ynxMuCLfFD09c8XPUCc8obfchoVR9Cn0f modernc.org/ccgo/v3 v3.15.12/go.mod h1:VFePOWoCd8uDGRJpq/zfJ29D0EVzMSyID8LCMWYbX6I= modernc.org/ccgo/v3 v3.15.13/go.mod h1:QHtvdpeODlXjdK3tsbpyK+7U9JV4PQsrPGIbtmc0KfY= modernc.org/ccgo/v3 v3.16.9 h1:AXquSwg7GuMk11pIdw7fmO1Y/ybgazVkMhsZWCV0mHM= +modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= modernc.org/ccorpus v1.11.1/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/ccorpus v1.11.4/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= @@ -3320,22 +3329,28 @@ modernc.org/libc v1.14.2/go.mod h1:MX1GBLnRLNdvmK9azU9LCxZ5lMyhrbEMK8rG3X/Fe34= modernc.org/libc v1.14.3/go.mod h1:GPIvQVOVPizzlqyRX3l756/3ppsAgg1QgPxjr5Q4agQ= modernc.org/libc v1.14.5/go.mod h1:2PJHINagVxO4QW/5OQdRrvMYo+bm5ClpUFfyXCYl9ak= modernc.org/libc v1.17.1 h1:Q8/Cpi36V/QBfuQaFVeisEBs3WqoGAJprZzmf7TfEYI= +modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.4.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= modernc.org/memory v1.0.5/go.mod h1:B7OYswTRnfGg+4tDH1t1OeUNnsy2viGTdME4tzd+IjM= modernc.org/memory v1.2.1 h1:dkRh86wgmq/bJu2cAS2oqBCz/KsMZU7TUM4CibQ7eBs= +modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/sqlite v1.14.6/go.mod h1:yiCvMv3HblGmzENNIaNtFhfaNIwcla4u2JQEwJPzfEc= modernc.org/sqlite v1.18.1 h1:ko32eKt3jf7eqIkCgPAeHMBXw3riNSLhl2f3loEF7o8= +modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= modernc.org/tcl v1.11.0/go.mod h1:zsTUpbQ+NxQEjOjCUlImDLPv1sG8Ww0qp66ZvyOxCgw= modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk= modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= diff --git a/pkg/acceptance/compose/gss/psql/Dockerfile b/pkg/acceptance/compose/gss/psql/Dockerfile index 5d3020c066a6..d4fda00b1f0b 100644 --- a/pkg/acceptance/compose/gss/psql/Dockerfile +++ b/pkg/acceptance/compose/gss/psql/Dockerfile @@ -1,5 +1,5 @@ # Build the test binary in a multistage build. -FROM golang:1.20 AS builder +FROM golang:1.21 AS builder WORKDIR /workspace COPY . . RUN go test -v -c -tags gss_compose -o gss.test diff --git a/pkg/cmd/roachprod/docker/Dockerfile b/pkg/cmd/roachprod/docker/Dockerfile index ea28a9bbaea6..ec214212bccf 100644 --- a/pkg/cmd/roachprod/docker/Dockerfile +++ b/pkg/cmd/roachprod/docker/Dockerfile @@ -12,7 +12,7 @@ RUN bazel build --config=crosslinux //pkg/cmd/roachprod:roachprod # Copy the roachprod binary to a stable location RUN cp $(bazel info bazel-bin --config=crosslinux)/pkg/cmd/roachprod/roachprod_/roachprod ./ -FROM golang:1.20 +FROM golang:1.21 COPY entrypoint.sh build.sh /build/ RUN ["/build/build.sh"] COPY --from=builder /build/roachprod /usr/local/bin/roachprod diff --git a/pkg/cmd/roachtest/tests/go_helpers.go b/pkg/cmd/roachtest/tests/go_helpers.go index a14081cac4cf..8a10a42e83a0 100644 --- a/pkg/cmd/roachtest/tests/go_helpers.go +++ b/pkg/cmd/roachtest/tests/go_helpers.go @@ -43,13 +43,13 @@ func installGolang( } if err := repeatRunE( - ctx, t, c, node, "download go", `curl -fsSL https://dl.google.com/go/go1.20.10.linux-amd64.tar.gz > /tmp/go.tgz`, + ctx, t, c, node, "download go", `curl -fsSL https://dl.google.com/go/go1.21.3.linux-amd64.tar.gz > /tmp/go.tgz`, ); err != nil { t.Fatal(err) } if err := repeatRunE( ctx, t, c, node, "verify tarball", `sha256sum -c - < Date: Fri, 20 Oct 2023 13:26:11 -0400 Subject: [PATCH 3/5] log: fix stacktrace test goroutine counts Previously, we would use the count of the string `goroutine ` as a proxy for the number of goroutines in the stacktrace. This stopped working in go 1.21 due to this change: https://github.com/golang/go/commit/51225f6fc648ba3e833f3493700c2996a816bdaa We should consider using a stacktrace parser in the future. Supports #112088 Epic: None Release note: None --- pkg/util/log/clog_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/util/log/clog_test.go b/pkg/util/log/clog_test.go index f6af4b89bf3f..870b83bb6b2d 100644 --- a/pkg/util/log/clog_test.go +++ b/pkg/util/log/clog_test.go @@ -586,17 +586,23 @@ func TestFatalStacktraceStderr(t *testing.T) { if !strings.Contains(cont, "clog_test") { t.Fatalf("stack trace does not contain file name: %s", cont) } + + // NB: the string "!goroutine" is used here in order to match the + // goroutine headers in the formatted output. The stacktrace + // itself can sometimes contain the string `goroutine` if one + // goroutine is spawned from another due to + // https://github.com/golang/go/commit/51225f6fc648ba3e833f3493700c2996a816bdaa switch traceback { case tracebackNone: - if strings.Count(cont, "goroutine ") > 0 { + if strings.Count(cont, "!goroutine ") > 0 { t.Fatalf("unexpected stack trace:\n%s", cont) } case tracebackSingle: - if strings.Count(cont, "goroutine ") != 1 { + if strings.Count(cont, "!goroutine ") != 1 { t.Fatalf("stack trace contains too many goroutines: %s", cont) } case tracebackAll: - if strings.Count(cont, "goroutine ") < 2 { + if strings.Count(cont, "!goroutine ") < 2 { t.Fatalf("stack trace contains less than two goroutines: %s", cont) } } From 62fd7ab0283d54cd6ddd8e3496af302844f9f1be Mon Sep 17 00:00:00 2001 From: Nathan VanBenschoten Date: Tue, 5 Dec 2023 01:46:59 -0500 Subject: [PATCH 4/5] build: expose knob to disable GC assist Fixes #115584. This commit updates our patched Go runtime to expose a knob to disable the runtime's GC assist mechanism. The knob is exposed under the `GODEBUG` environment variable, and can be accessed with `GODEBUG=gcnoassist=1`. For now, this is just meant for experimentation purposes. It will assist us as we look to reduce the impact the GC has on tail latency. Release note: None --- WORKSPACE | 16 +++---- build/bazelutil/distdir_files.bzl | 12 ++--- .../build-and-publish-patched-go/diff.patch | 48 +++++++++++++++++++ .../build-and-publish-patched-go/impl-fips.sh | 2 + 4 files changed, 64 insertions(+), 14 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index cebeaac979a2..d71b7b570aae 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -163,13 +163,13 @@ load( go_download_sdk( name = "go_sdk", sdks = { - "darwin_amd64": ("go1.21.3.darwin-amd64.tar.gz", "253d8d4b32a1d7731dff1245f009362858a0c685af8f52b671dd906b2c67d78d"), - "darwin_arm64": ("go1.21.3.darwin-arm64.tar.gz", "877543c11149341e4954cb2e625deb7974e94c3c77f5f71a24d35e54cb54fb05"), - "linux_amd64": ("go1.21.3.linux-amd64.tar.gz", "3b0307b4e91d6b34870ed1d29366aba77cb864dc93b7098cdfb5d4619cb58566"), - "linux_arm64": ("go1.21.3.linux-arm64.tar.gz", "c0d2da5e1b9ff93d0e4262189e59586cc0c17c207578429f716de2d5799ba36a"), - "windows_amd64": ("go1.21.3.windows-amd64.tar.gz", "c0e2957014e72056ed1c2c080d772d7c8e96a3143f228f6b511231fc31c07593"), + "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"), }, - urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/{}"], + urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231205-160258/{}"], version = "1.21.3", ) @@ -608,8 +608,8 @@ distdir_repositories() go_download_sdk( name = "go_sdk_fips", sdks = { - "linux_amd64": ("go1.21.3fips.linux-amd64.tar.gz", "216acc2939bf16748ec240ffe1752b442ec098bd9ac5e12ecd44db4ff77e0ab9"), + "linux_amd64": ("go1.21.3fips.linux-amd64.tar.gz", "03a3494f7b9d8a63750f72afd4f398baa723509a3c14dbff888a857ca01f0b5c"), }, - urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/{}"], + urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20231205-160258/{}"], version = "1.21.3fips", ) diff --git a/build/bazelutil/distdir_files.bzl b/build/bazelutil/distdir_files.bzl index dcfd62595364..cce100937ab5 100644 --- a/build/bazelutil/distdir_files.bzl +++ b/build/bazelutil/distdir_files.bzl @@ -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/20231019-214851/go1.21.3.darwin-amd64.tar.gz": "253d8d4b32a1d7731dff1245f009362858a0c685af8f52b671dd906b2c67d78d", - "https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/go1.21.3.darwin-arm64.tar.gz": "877543c11149341e4954cb2e625deb7974e94c3c77f5f71a24d35e54cb54fb05", - "https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/go1.21.3.linux-amd64.tar.gz": "3b0307b4e91d6b34870ed1d29366aba77cb864dc93b7098cdfb5d4619cb58566", - "https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/go1.21.3.linux-arm64.tar.gz": "c0d2da5e1b9ff93d0e4262189e59586cc0c17c207578429f716de2d5799ba36a", - "https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/go1.21.3.windows-amd64.tar.gz": "c0e2957014e72056ed1c2c080d772d7c8e96a3143f228f6b511231fc31c07593", - "https://storage.googleapis.com/public-bazel-artifacts/go/20231019-214851/go1.21.3fips.linux-amd64.tar.gz": "216acc2939bf16748ec240ffe1752b442ec098bd9ac5e12ecd44db4ff77e0ab9", + "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/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", diff --git a/build/teamcity/internal/release/build-and-publish-patched-go/diff.patch b/build/teamcity/internal/release/build-and-publish-patched-go/diff.patch index 35393db3cea2..101fccd43b36 100644 --- a/build/teamcity/internal/release/build-and-publish-patched-go/diff.patch +++ b/build/teamcity/internal/release/build-and-publish-patched-go/diff.patch @@ -1,3 +1,31 @@ +diff --git a/src/runtime/extern.go b/src/runtime/extern.go +index 26dcf0bd52..75865d2868 100644 +--- a/src/runtime/extern.go ++++ b/src/runtime/extern.go +@@ -85,6 +85,10 @@ It is a comma-separated list of name=val pairs setting these named variables: + making every garbage collection a stop-the-world event. Setting gcstoptheworld=2 + also disables concurrent sweeping after the garbage collection finishes. + ++ gcnoassist: setting gcnoassist=1 disables garbage collection assist, minimizing ++ garbage collection overhead for user goroutines at the expense of a higher risk ++ of out-of-memory failures with high allocation rates. ++ + gctrace: setting gctrace=1 causes the garbage collector to emit a single line to standard + error at each collection, summarizing the amount of memory collected and the + length of the pause. The format of this line is subject to change. Included in +diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go +index 44479cc2be..a24ce64a24 100644 +--- a/src/runtime/malloc.go ++++ b/src/runtime/malloc.go +@@ -1270,7 +1270,7 @@ func mallocgc(size uintptr, typ *_type, needzero bool) unsafe.Pointer { + // Returns the G for which the assist credit was accounted. + func deductAssistCredit(size uintptr) *g { + var assistG *g +- if gcBlackenEnabled != 0 { ++ if debug.gcnoassist == 0 && gcBlackenEnabled != 0 { + // Charge the current user G for this allocation. + assistG = getg() + if assistG.m.curg != nil { diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 554a60d747..8d64ee31c8 100644 --- a/src/runtime/proc.go @@ -74,6 +102,26 @@ index 554a60d747..8d64ee31c8 100644 if gcBlackenEnabled != 0 && gp.gcAssistBytes > 0 { // Flush assist credit to the global pool. This gives +diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go +index 92a7e021ee..2796baf922 100644 +--- a/src/runtime/runtime1.go ++++ b/src/runtime/runtime1.go +@@ -315,6 +315,7 @@ var debug struct { + gcpacertrace int32 + gcshrinkstackoff int32 + gcstoptheworld int32 ++ gcnoassist int32 + gctrace int32 + invalidptr int32 + madvdontneed int32 // for Linux; issue 28466 +@@ -348,6 +349,7 @@ var dbgvars = []*dbgVar{ + {name: "gcpacertrace", value: &debug.gcpacertrace}, + {name: "gcshrinkstackoff", value: &debug.gcshrinkstackoff}, + {name: "gcstoptheworld", value: &debug.gcstoptheworld}, ++ {name: "gcnoassist", value: &debug.gcnoassist}, + {name: "gctrace", value: &debug.gctrace}, + {name: "invalidptr", value: &debug.invalidptr}, + {name: "madvdontneed", value: &debug.madvdontneed}, diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index f4c76abd1c..57672bd8c5 100644 --- a/src/runtime/runtime2.go diff --git a/build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh b/build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh index 4ed8f5d1a26a..814e49159d92 100755 --- a/build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh +++ b/build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh @@ -34,3 +34,5 @@ GOVERS=$(go/bin/go env GOVERSION) GOOS=$(go/bin/go env GOOS) GOARCH=$(go/bin/go env GOARCH) tar cf - go | gzip -9 > /artifacts/$GOVERS.$GOOS-$GOARCH.tar.gz + +sha256sum /artifacts/$GOVERS.$GOOS-$GOARCH.tar.gz From 474a41f8798fb96de91c51e45a633819b5028fc9 Mon Sep 17 00:00:00 2001 From: Rail Aliiev Date: Wed, 6 Dec 2023 11:08:21 -0500 Subject: [PATCH 5/5] build: update go to 1.21.5 * [ ] 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:` and `go`). Epic: none Release note: None --- .bazelrc | 2 +- WORKSPACE | 56 +++++++++++-------- build/bazelutil/distdir_files.bzl | 12 ++-- build/bootstrap/bootstrap-debian.sh | 4 +- .../build-and-publish-patched-go/impl-fips.sh | 2 +- .../build-and-publish-patched-go/impl.sh | 6 +- 6 files changed, 45 insertions(+), 37 deletions(-) diff --git a/.bazelrc b/.bazelrc index 77e71eb0e8c1..efa8198721a7 100644 --- a/.bazelrc +++ b/.bazelrc @@ -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 diff --git a/WORKSPACE b/WORKSPACE index d71b7b570aae..2f31c55ae56e 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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", @@ -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 @@ -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") @@ -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:topojson@3.0.2.patch", - "//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 # @@ -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") @@ -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", ) diff --git a/build/bazelutil/distdir_files.bzl b/build/bazelutil/distdir_files.bzl index cce100937ab5..6c818a84ef3f 100644 --- a/build/bazelutil/distdir_files.bzl +++ b/build/bazelutil/distdir_files.bzl @@ -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", diff --git a/build/bootstrap/bootstrap-debian.sh b/build/bootstrap/bootstrap-debian.sh index ed089db579f5..8562e9845581 100755 --- a/build/bootstrap/bootstrap-debian.sh +++ b/build/bootstrap/bootstrap-debian.sh @@ -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 - <