diff --git a/.bazelrc b/.bazelrc index 53a7c5e88f03..6043597f6c27 100644 --- a/.bazelrc +++ b/.bazelrc @@ -79,7 +79,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.20.7fips 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/BUILD.bazel b/BUILD.bazel index 2cec258e1e18..aef1c4187372 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -57,6 +57,7 @@ exports_files([ # gazelle:resolve go github.com/cockroachdb/cockroach/pkg/util/json_test //pkg/util/json:json_test # gazelle:resolve go google.golang.org/genproto/googleapis/pubsub/v1 @org_golang_google_genproto//googleapis/pubsub/v1:pubsub # gazelle:resolve go google.golang.org/genproto/googleapis/cloud/kms/v1 @org_golang_google_genproto//googleapis/cloud/kms/v1:kms +# gazelle:resolve go google.golang.org/genproto/googleapis/devtools/build/v1 @org_golang_google_genproto//googleapis/devtools/build/v1:build # See pkg/kv/kvpb/gen/BUILD.bazel for more details. # diff --git a/DEPS.bzl b/DEPS.bzl index 80e092679df4..ed5b37369e7e 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -2399,10 +2399,10 @@ def go_deps(): name = "com_github_docker_docker", build_file_proto_mode = "disable_global", importpath = "github.com/docker/docker", - sha256 = "b96610497d8d7b41eff039cd4b4ba595eedb3944b653b813f087364805e3db76", - strip_prefix = "github.com/moby/moby@v20.10.6+incompatible", + sha256 = "92fd2184ec4e265dae066c73fc9c7d40254eaeb804f659e7a4cc27ebd3689fcc", + strip_prefix = "github.com/moby/moby@v24.0.6+incompatible", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/moby/moby/com_github_moby_moby-v20.10.6+incompatible.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/moby/moby/com_github_moby_moby-v24.0.6+incompatible.zip", ], ) go_repository( diff --git a/WORKSPACE b/WORKSPACE index 001a112214a4..5e90a1321cef 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -8,12 +8,12 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Load go bazel tools. This gives us access to the go bazel SDK/toolchains. http_archive( name = "io_bazel_rules_go", - sha256 = "7ab77b5bd3ac04a65860b0e26f2855c977d463d8e9b5ce2458e516b110eb5eeb", - strip_prefix = "cockroachdb-rules_go-f1ab269", + sha256 = "824f524fed040e3844025a4274ad03523c38aabe1017c52f72e6d721311f07e3", + strip_prefix = "cockroachdb-rules_go-310eb8a", urls = [ - # cockroachdb/rules_go as of f1ab26925b5da24119d38115a657f27a90288db5 - # (upstream release-0.40 plus a few patches). - "https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-rules_go-v0.27.0-341-gf1ab269.tar.gz", + # cockroachdb/rules_go as of 310eb8ab3c7d53c21c8a5805d1ea77e39cf8552b + # (upstream release-0.41 plus a few patches). + "https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-rules_go-v0.27.0-352-g310eb8a.tar.gz", ] ) @@ -129,22 +129,22 @@ http_archive( "-p1", ], patches = [ - "@io_bazel_rules_go//third_party:go_googleapis-deletebuild.patch", - "@io_bazel_rules_go//third_party:go_googleapis-directives.patch", - "@io_bazel_rules_go//third_party:go_googleapis-gazelle.patch", "@com_github_cockroachdb_cockroach//build/patches:go_googleapis.patch", ], sha256 = "ba694861340e792fd31cb77274eacaf6e4ca8bda97707898f41d8bebfd8a4984", strip_prefix = "googleapis-83c3605afb5a39952bf0a0809875d41cf2a558ca", # master, as of 2022-12-05 - # NB: You may have to update this when bumping rules_go. Bumping to the same - # version in rules_go (go/private/repositories.bzl) is probably what you - # want to do. urls = [ "https://storage.googleapis.com/public-bazel-artifacts/bazel/googleapis-83c3605afb5a39952bf0a0809875d41cf2a558ca.zip", ], ) +load("@go_googleapis//:repository_rules.bzl", "switched_rules_by_language") + +switched_rules_by_language( + name = "com_google_googleapis_imports", +) + # com_github_golang_mock handled in DEPS.bzl. # Load the go dependencies and invoke them. @@ -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.20.8.darwin-amd64.tar.gz", "35b0ccd50619bb9fd7ad9418ab937fd9304b219b3b6ecbb89baf34b001ef618d"), + "darwin_arm64": ("go1.20.8.darwin-arm64.tar.gz", "265b2994e56ef0b2fc3b33cae4cb8bad12c4cbfd9ab24e3a58af14fe857f9476"), + "freebsd_amd64": ("go1.20.8.freebsd-amd64.tar.gz", "ea64e0eb4eb0af7ad59d26b9fb6d3facf32393ad6a29d29c34ba7903523443e6"), + "linux_amd64": ("go1.20.8.linux-amd64.tar.gz", "1c4e5509ea7a9619b010aece658af0e4b3be35ba7eeb4e2ba2350b4f56b1209a"), + "linux_arm64": ("go1.20.8.linux-arm64.tar.gz", "e96cb9d4040e938be85be382aed6b9560ee4a372623861040e5b7935ff838bd9"), + "windows_amd64": ("go1.20.8.windows-amd64.tar.gz", "00bf5902a559d2b297a042f87241c2ba4c1139d6bfe02af6e95d4bd6a349f06a"), }, - urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20230614-165357/{}"], - version = "1.19.10", + urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20230906-184959/{}"], + version = "1.20.8", ) # To point to a local SDK path, use the following instead. We'll call the @@ -610,8 +610,8 @@ distdir_repositories() go_download_sdk( name = "go_sdk_fips", sdks = { - "linux_amd64": ("go1.19.10fips.linux-amd64.tar.gz", "c9348fc964fb2893471a6ba91feead205a6f83cd427bc3847949382417005496"), + "linux_amd64": ("go1.20.7fips.linux-amd64.tar.gz", "9cfd219231beb3cf3c9f0258db0edd9af10dadeaa5d563a9f6029e517e44472d"), }, - urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20230614-165357/{}"], - version = "1.19.10fips", + urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20230906-184959/{}"], + version = "1.20.7fips", ) diff --git a/build/bazelutil/distdir_files.bzl b/build/bazelutil/distdir_files.bzl index 6f4c8f688c97..fb0d490a4c6f 100644 --- a/build/bazelutil/distdir_files.bzl +++ b/build/bazelutil/distdir_files.bzl @@ -786,7 +786,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/mmatczuk/go_generics/com_github_mmatczuk_go_generics-v0.0.0-20181212143635-0aaa050f9bab.zip": "18c1e95c93f1f82be0184bc13bf49eb4350c7a4ff524b1bf440b3eb9ff14acc9", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/mmcloughlin/geohash/com_github_mmcloughlin_geohash-v0.9.0.zip": "7162856858d9bb3c411d4b42ad19dfff579341ddf0580122e3f1ac3be05c7441", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/moby/locker/com_github_moby_locker-v1.0.1.zip": "f07361346d12a24e168db7fb2f21281883bee6060f1aedf7507bccf20c4a793f", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/moby/moby/com_github_moby_moby-v20.10.6+incompatible.zip": "b96610497d8d7b41eff039cd4b4ba595eedb3944b653b813f087364805e3db76", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/moby/moby/com_github_moby_moby-v24.0.6+incompatible.zip": "92fd2184ec4e265dae066c73fc9c7d40254eaeb804f659e7a4cc27ebd3689fcc", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/moby/spdystream/com_github_moby_spdystream-v0.2.0.zip": "9db6d001a80f4c3cb332bb8a1bb9260908e1ffa9a20491e9bc05358263eed278", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/moby/sys/mountinfo/com_github_moby_sys_mountinfo-v0.5.0.zip": "8dfcdd129483164002cae296d0d4e58b139b6576b25e06c325963d902079018c", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/moby/sys/signal/com_github_moby_sys_signal-v0.6.0.zip": "9e4076b073a7536bc05fdfc2432ece1c5d7147a538c19a98b35937a177f8d9e5", @@ -1166,7 +1166,7 @@ DISTDIR_FILES = { "https://storage.googleapis.com/public-bazel-artifacts/bazel/bmatcuk-doublestar-v4.0.1-0-gf7a8118.tar.gz": "d11c3b3a45574f89d6a6b2f50e53feea50df60407b35f36193bf5815d32c79d1", "https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-protobuf-3f5d91f.tar.gz": "6d4e7fe1cbd958dee69ce9becbf8892d567f082b6782d3973a118d0aa00807a8", "https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-rules_foreign_cc-6f7f1b1.tar.gz": "272ac2cde4efd316c8d7c0140dee411c89da104466701ac179286ef5a89c7b58", - "https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-rules_go-v0.27.0-341-gf1ab269.tar.gz": "7ab77b5bd3ac04a65860b0e26f2855c977d463d8e9b5ce2458e516b110eb5eeb", + "https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-rules_go-v0.27.0-352-g310eb8a.tar.gz": "824f524fed040e3844025a4274ad03523c38aabe1017c52f72e6d721311f07e3", "https://storage.googleapis.com/public-bazel-artifacts/bazel/google-starlark-go-e043a3d.tar.gz": "a35c6468e0e0921833a63290161ff903295eaaf5915200bbce272cbc8dfd1c1c", "https://storage.googleapis.com/public-bazel-artifacts/bazel/googleapis-83c3605afb5a39952bf0a0809875d41cf2a558ca.zip": "ba694861340e792fd31cb77274eacaf6e4ca8bda97707898f41d8bebfd8a4984", "https://storage.googleapis.com/public-bazel-artifacts/bazel/platforms-0.0.4.tar.gz": "079945598e4b6cc075846f7fd6a9d0857c33a7afc0de868c2ccb96405225135d", @@ -1192,13 +1192,13 @@ 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/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/20230906-184959/go1.20.7fips.linux-amd64.tar.gz": "9cfd219231beb3cf3c9f0258db0edd9af10dadeaa5d563a9f6029e517e44472d", + "https://storage.googleapis.com/public-bazel-artifacts/go/20230906-184959/go1.20.8.darwin-amd64.tar.gz": "35b0ccd50619bb9fd7ad9418ab937fd9304b219b3b6ecbb89baf34b001ef618d", + "https://storage.googleapis.com/public-bazel-artifacts/go/20230906-184959/go1.20.8.darwin-arm64.tar.gz": "265b2994e56ef0b2fc3b33cae4cb8bad12c4cbfd9ab24e3a58af14fe857f9476", + "https://storage.googleapis.com/public-bazel-artifacts/go/20230906-184959/go1.20.8.freebsd-amd64.tar.gz": "ea64e0eb4eb0af7ad59d26b9fb6d3facf32393ad6a29d29c34ba7903523443e6", + "https://storage.googleapis.com/public-bazel-artifacts/go/20230906-184959/go1.20.8.linux-amd64.tar.gz": "1c4e5509ea7a9619b010aece658af0e4b3be35ba7eeb4e2ba2350b4f56b1209a", + "https://storage.googleapis.com/public-bazel-artifacts/go/20230906-184959/go1.20.8.linux-arm64.tar.gz": "e96cb9d4040e938be85be382aed6b9560ee4a372623861040e5b7935ff838bd9", + "https://storage.googleapis.com/public-bazel-artifacts/go/20230906-184959/go1.20.8.windows-amd64.tar.gz": "00bf5902a559d2b297a042f87241c2ba4c1139d6bfe02af6e95d4bd6a349f06a", "https://storage.googleapis.com/public-bazel-artifacts/gomod/github.com/bazelbuild/buildtools/v6.1.2-0-gb182fc4/bazelbuild-buildtools-v6.1.2-0-gb182fc4.tar.gz": "d71a889e3bc50cc8b9d42c859e15a74f7c8d10b6786f8dd82f08f2bf24e5bdc6", "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", diff --git a/build/bazelutil/nogo_config.json b/build/bazelutil/nogo_config.json index cddfbc90d5e8..dcb4af863874 100644 --- a/build/bazelutil/nogo_config.json +++ b/build/bazelutil/nogo_config.json @@ -1964,6 +1964,9 @@ "only_files": { "cockroach/pkg/.*$": "first-party code", "cockroach/bazel-out/.*/bin/pkg/.*$": "first-party code" + }, + "exclude_files": { + "pkg/util/goschedstats/runtime_go.*.go$": "patch code" } }, "unreachable": { diff --git a/build/bootstrap/bootstrap-debian.sh b/build/bootstrap/bootstrap-debian.sh index 7b4b7cf1a45c..823c6586bbad 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.19.10.linux-amd64.tar.gz > /tmp/go.tgz +curl -fsSL https://dl.google.com/go/go1.20.7.linux-amd64.tar.gz > /tmp/go.tgz sha256sum -c - < /tmp/go.tgz + curl -fsSL https://dl.google.com/go/go1.20.7.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 e1788223e7..5ed1fb40ba 100644 +index 9381d1e3f7..8182f8e9bc 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -474,7 +474,6 @@ type g struct { @@ -77,7 +89,7 @@ index e1788223e7..5ed1fb40ba 100644 @@ -488,6 +487,9 @@ type g struct { labels unsafe.Pointer // profiler labels timer *timer // cached timer for time.Sleep - selectDone uint32 // are we participating in a select and did someone win the race? + 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 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 0fffbaca5e4a..87113df29995 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.19-fips-release -GO_VERSION=1.19.10 +GO_FIPS_COMMIT=go1.20-fips-release +GO_VERSION=1.20.7 # Install build dependencies yum install git golang golang-bin openssl openssl-devel -y 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 9c98a47f5b79..26002f21b4f5 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,12 +3,12 @@ set -xeuo pipefail # When updating to a new Go version, update all of these variables. -GOVERS=1.19.10 +GOVERS=1.20.8 GOLINK=https://go.dev/dl/go$GOVERS.src.tar.gz -SRCSHASUM=13755bcce529747d5f2930dee034730c86d02bd3e521ab3e2bbede548d3b953f +SRCSHASUM=38d71714fa5279f97240451956d8e47e3c1b6a5de7cb84137949d62b5dd3182e # 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=ea64e0eb4eb0af7ad59d26b9fb6d3facf32393ad6a29d29c34ba7903523443e6 apt-get update DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ @@ -19,7 +19,6 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ curl \ git \ gnupg2 \ - golang \ make \ python-is-python3 \ python3 \ @@ -31,6 +30,13 @@ update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 100 \ 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 \ + && rm golang.tar.gz + +PATH=$PATH:/usr/local/go/bin + # libtapi is required for later versions of MacOSX. git clone https://github.com/tpoechtrager/apple-libtapi.git cd apple-libtapi @@ -40,14 +46,14 @@ git checkout a66284251b46d591ee4a0cb4cf561b92a0c138d8 cd .. rm -rf apple-libtapi -curl -fsSL https://storage.googleapis.com/public-bazel-artifacts/toolchains/crosstool-ng/x86_64/20220711-205918/aarch64-unknown-linux-gnu.tar.gz -o aarch64-unknown-linux-gnu.tar.gz -echo '58407f1f3ed490bd0a0a500b23b88503fbcc25f0f69a0b7f8a3e8e7b9237341b aarch64-unknown-linux-gnu.tar.gz' | sha256sum -c - +curl -fsSL https://storage.googleapis.com/public-bazel-artifacts/toolchains/crosstool-ng/x86_64/20230906-034412/aarch64-unknown-linux-gnu.tar.gz -o aarch64-unknown-linux-gnu.tar.gz +echo 'f9b073774826747cf2a91514d5ab27e3ba7f0c7b63acaf80a5ed58c82b08fd44 aarch64-unknown-linux-gnu.tar.gz' | sha256sum -c - curl -fsSL https://storage.googleapis.com/public-bazel-artifacts/toolchains/osxcross/x86_64/20220317-165434/x86_64-apple-darwin21.2.tar.gz -o x86_64-apple-darwin21.2.tar.gz echo '751365dbfb5db66fe8e9f47fcf82cbbd7d1c176b79112ab91945d1be1d160dd5 x86_64-apple-darwin21.2.tar.gz' | sha256sum -c - -curl -fsSL https://storage.googleapis.com/public-bazel-artifacts/toolchains/crosstool-ng/x86_64/20220711-205918/x86_64-unknown-linux-gnu.tar.gz -o x86_64-unknown-linux-gnu.tar.gz -echo '8b0c246c3ebd02aceeb48bb3d70c779a1503db3e99be332ac256d4f3f1c22d47 x86_64-unknown-linux-gnu.tar.gz' | sha256sum -c - -curl -fsSL https://storage.googleapis.com/public-bazel-artifacts/toolchains/crosstool-ng/x86_64/20220711-205918/x86_64-w64-mingw32.tar.gz -o x86_64-w64-mingw32.tar.gz -echo 'b87814aaeed8c68679852029de70cee28f96c352ed31c4c520e7bee55999b1c6 x86_64-w64-mingw32.tar.gz' | sha256sum -c - +curl -fsSL https://storage.googleapis.com/public-bazel-artifacts/toolchains/crosstool-ng/x86_64/20230906-034412/x86_64-unknown-linux-gnu.tar.gz -o x86_64-unknown-linux-gnu.tar.gz +echo '5f79da0a9e580bc0a869ca32c2e5a21990676ec567aabf54ccc1dec4c3f2c827 x86_64-unknown-linux-gnu.tar.gz' | sha256sum -c - +curl -fsSL https://storage.googleapis.com/public-bazel-artifacts/toolchains/crosstool-ng/x86_64/20230906-034412/x86_64-w64-mingw32.tar.gz -o x86_64-w64-mingw32.tar.gz +echo '94e64e0e8de05706dfd5ab2f1fee6e7f75280e35b09b5628980805d27939b418 x86_64-w64-mingw32.tar.gz' | sha256sum -c - echo *.tar.gz | xargs -n1 tar -xzf rm *.tar.gz diff --git a/build/toolchains/REPOSITORIES.bzl b/build/toolchains/REPOSITORIES.bzl index bb721bb82ca1..5d3b57d32387 100644 --- a/build/toolchains/REPOSITORIES.bzl +++ b/build/toolchains/REPOSITORIES.bzl @@ -12,25 +12,25 @@ def toolchain_dependencies(): name = "toolchain_cross_aarch64-unknown-linux-gnu", host = "x86_64", target = "aarch64-unknown-linux-gnu", - tarball_sha256 = "58407f1f3ed490bd0a0a500b23b88503fbcc25f0f69a0b7f8a3e8e7b9237341b", + tarball_sha256 = "f9b073774826747cf2a91514d5ab27e3ba7f0c7b63acaf80a5ed58c82b08fd44", ) _crosstool_toolchain_repo( name = "toolchain_cross_s390x-ibm-linux-gnu", host = "x86_64", target = "s390x-ibm-linux-gnu", - tarball_sha256 = "c1e82a3cd7f0989abbb7228d21b217c235b79559e4460ef255a76b7a813240ce", + tarball_sha256 = "027d7d3b89d0c9745243610b9c12aa26f5605884b058934645cb344927228dab", ) _crosstool_toolchain_repo( name = "toolchain_cross_x86_64-unknown-linux-gnu", host = "x86_64", target = "x86_64-unknown-linux-gnu", - tarball_sha256 = "8b0c246c3ebd02aceeb48bb3d70c779a1503db3e99be332ac256d4f3f1c22d47", + tarball_sha256 = "5f79da0a9e580bc0a869ca32c2e5a21990676ec567aabf54ccc1dec4c3f2c827", ) _crosstool_toolchain_repo( name = "toolchain_cross_x86_64-w64-mingw32", host = "x86_64", target = "x86_64-w64-mingw32", - tarball_sha256 = "b87814aaeed8c68679852029de70cee28f96c352ed31c4c520e7bee55999b1c6", + tarball_sha256 = "94e64e0e8de05706dfd5ab2f1fee6e7f75280e35b09b5628980805d27939b418", ) _crosstool_toolchain_repo( name = "armtoolchain_cross_aarch64-unknown-linux-gnu", diff --git a/build/toolchains/crosstool-ng/toolchain.bzl b/build/toolchains/crosstool-ng/toolchain.bzl index 1d427844c680..7d0ac61c2717 100644 --- a/build/toolchains/crosstool-ng/toolchain.bzl +++ b/build/toolchains/crosstool-ng/toolchain.bzl @@ -1,6 +1,6 @@ def _impl(rctx): if rctx.attr.host == "x86_64": - url = "https://storage.googleapis.com/public-bazel-artifacts/toolchains/crosstool-ng/{}/20220711-205918/{}.tar.gz".format(rctx.attr.host, rctx.attr.target) + url = "https://storage.googleapis.com/public-bazel-artifacts/toolchains/crosstool-ng/{}/20230906-034412/{}.tar.gz".format(rctx.attr.host, rctx.attr.target) elif rctx.attr.host == "aarch64": url = "https://storage.googleapis.com/public-bazel-artifacts/toolchains/crosstool-ng/{}/20220711-204538/{}.tar.gz".format(rctx.attr.host, rctx.attr.target) rctx.download_and_extract( diff --git a/build/toolchains/toolchainbuild/crosstool-ng/crypto.h.patch b/build/toolchains/toolchainbuild/crosstool-ng/crypto.h.patch new file mode 100644 index 000000000000..af025d4bf4d1 --- /dev/null +++ b/build/toolchains/toolchainbuild/crosstool-ng/crypto.h.patch @@ -0,0 +1,10 @@ +--- include/openssl/crypto.h ++++ include/openssl/crypto.h +14c14,16 +< +--- +> #ifndef _GNU_SOURCE +> # define _GNU_SOURCE +> #endif +558a561 +> diff --git a/build/toolchains/toolchainbuild/crosstool-ng/perform-build.sh b/build/toolchains/toolchainbuild/crosstool-ng/perform-build.sh index abd203b85942..15d06cae02fc 100755 --- a/build/toolchains/toolchainbuild/crosstool-ng/perform-build.sh +++ b/build/toolchains/toolchainbuild/crosstool-ng/perform-build.sh @@ -93,6 +93,14 @@ build_ncurses aarch64-unknown-linux-gnu build_ncurses s390x-ibm-linux-gnu cd .. +# Add openssl header files needed by the FIPS build. +mkdir openssl \ + && curl -fsSL https://github.com/openssl/openssl/releases/download/openssl-3.1.2/openssl-3.1.2.tar.gz -o openssl.tar.gz \ + && echo 'a0ce69b8b97ea6a35b96875235aa453b966ba3cba8af2de23657d8b6767d6539 openssl.tar.gz' | sha256sum -c - \ + && tar --strip-components=1 -C openssl -xzf openssl.tar.gz \ + && cd openssl && ./Configure && make && patch -p0 <../bootstrap/crypto.h.patch \ + && cp -r include/openssl /x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include && cd .. + apt-get purge -y gcc g++ && apt-get autoremove -y apt-get update \ @@ -101,7 +109,6 @@ apt-get update \ && update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 100 \ --slave /usr/bin/clang++ clang++ /usr/bin/clang++-10 - # Bundle artifacts bundle() { filename=/artifacts/$(echo $1 | rev | cut -d/ -f1 | rev).tar.gz diff --git a/docs/generated/http/BUILD.bazel b/docs/generated/http/BUILD.bazel index cc9dd4b5dd4c..1cd84bfa6744 100644 --- a/docs/generated/http/BUILD.bazel +++ b/docs/generated/http/BUILD.bazel @@ -57,6 +57,7 @@ genrule( "@com_google_protobuf//:duration_proto", "@com_google_protobuf//:timestamp_proto", "@go_googleapis//google/api:annotations_proto", + "@go_googleapis//google/api:http_proto", "@io_etcd_go_raft_v3//raftpb:raftpb_proto", ], outs = [ diff --git a/go.mod b/go.mod index 445e65611540..8d3d7bda871d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/cockroachdb/cockroach -go 1.19 +go 1.20 // The following dependencies are key infrastructure dependencies and // should be updated as their own commit (i.e. not bundled with a dep @@ -128,7 +128,7 @@ require ( github.com/dave/dst v0.24.0 github.com/davecgh/go-spew v1.1.1 github.com/docker/distribution v2.7.1+incompatible - github.com/docker/docker v20.10.17+incompatible + github.com/docker/docker v24.0.6+incompatible github.com/docker/go-connections v0.4.0 github.com/dustin/go-humanize v1.0.0 github.com/edsrzf/mmap-go v1.0.0 @@ -440,7 +440,7 @@ replace vitess.io/vitess => github.com/cockroachdb/vitess v0.0.0-20210218160543- replace gopkg.in/yaml.v2 => github.com/cockroachdb/yaml v0.0.0-20210825132133-2d6955c8edbc -replace github.com/docker/docker => github.com/moby/moby v20.10.6+incompatible +replace github.com/docker/docker => github.com/moby/moby v24.0.6+incompatible replace golang.org/x/time => github.com/cockroachdb/x-time v0.3.1-0.20230525123634-71747adb5d5c diff --git a/go.sum b/go.sum index f79d8c340660..4ea3a6bf3b81 100644 --- a/go.sum +++ b/go.sum @@ -1741,8 +1741,8 @@ github.com/mmatczuk/go_generics v0.0.0-20181212143635-0aaa050f9bab/go.mod h1:Fs8 github.com/mmcloughlin/geohash v0.9.0 h1:FihR004p/aE1Sju6gcVq5OLDqGcMnpBY+8moBqIsVOs= github.com/mmcloughlin/geohash v0.9.0/go.mod h1:oNZxQo5yWJh0eMQEP/8hwQuVx9Z9tjwFUqcTB1SmG0c= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= -github.com/moby/moby v20.10.6+incompatible h1:3wn5wW3KwjAv8Z36VHdbvaqvY273JiWUDFuudH0z5Vs= -github.com/moby/moby v20.10.6+incompatible/go.mod h1:fDXVQ6+S340veQPv35CzDahGBmHsiclFwfEygB/TWMc= +github.com/moby/moby v24.0.6+incompatible h1:O/XZsZtaOVTYszsJQlr9pN1Zo1aRSH0KCWAIa6Kpm3s= +github.com/moby/moby v24.0.6+incompatible/go.mod h1:fDXVQ6+S340veQPv35CzDahGBmHsiclFwfEygB/TWMc= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= diff --git a/pkg/acceptance/cluster/docker.go b/pkg/acceptance/cluster/docker.go index a81ba6c904bc..05b837b459fe 100644 --- a/pkg/acceptance/cluster/docker.go +++ b/pkg/acceptance/cluster/docker.go @@ -280,7 +280,12 @@ func (c *Container) Restart(ctx context.Context, timeout *time.Duration) error { } else if ci.State.Running { exp = append(exp, eventDie) } - if err := c.cluster.client.ContainerRestart(ctx, c.id, timeout); err != nil { + + timeoutSeconds := int(timeout.Seconds()) + stopOpts := container.StopOptions{ + Timeout: &timeoutSeconds, + } + if err := c.cluster.client.ContainerRestart(ctx, c.id, stopOpts); err != nil { return err } c.cluster.expectEvent(c, append(exp, eventRestart)...) @@ -407,7 +412,7 @@ func (cli resilientDockerClient) ContainerCreate( networkingConfig *network.NetworkingConfig, platformSpec *specs.Platform, containerName string, -) (container.ContainerCreateCreatedBody, error) { +) (container.CreateResponse, error) { response, err := cli.APIClient.ContainerCreate( ctx, config, hostConfig, networkingConfig, platformSpec, containerName, ) @@ -419,7 +424,7 @@ func (cli resilientDockerClient) ContainerCreate( }) if cerr != nil { log.Infof(ctx, "unable to list containers: %v", cerr) - return container.ContainerCreateCreatedBody{}, err + return container.CreateResponse{}, err } for _, c := range containers { for _, n := range c.Names { @@ -435,7 +440,7 @@ func (cli resilientDockerClient) ContainerCreate( } if rerr := cli.ContainerRemove(ctx, c.ID, options); rerr != nil { log.Infof(ctx, "unable to remove container: %v", rerr) - return container.ContainerCreateCreatedBody{}, err + return container.CreateResponse{}, err } return cli.ContainerCreate(ctx, config, hostConfig, networkingConfig, platformSpec, containerName) } diff --git a/pkg/acceptance/compose/gss/docker-compose.yml b/pkg/acceptance/compose/gss/docker-compose.yml index 089d30f15309..87377f1daf77 100644 --- a/pkg/acceptance/compose/gss/docker-compose.yml +++ b/pkg/acceptance/compose/gss/docker-compose.yml @@ -17,7 +17,7 @@ services: - keytab:/keytab - ${COCKROACH_BINARY:-../../../../cockroach-linux-2.6.32-gnu-amd64}:/cockroach/cockroach psql: - image: cockroachdb/acceptance-gss-psql:20221215-102339 + image: cockroachdb/acceptance-gss-psql:20230907-113902 user: "${UID}:${GID}" depends_on: - cockroach diff --git a/pkg/acceptance/compose/gss/psql/Dockerfile b/pkg/acceptance/compose/gss/psql/Dockerfile index c229b75f4c21..5d3020c066a6 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.19 AS builder +FROM golang:1.20 AS builder WORKDIR /workspace COPY . . RUN go test -v -c -tags gss_compose -o gss.test diff --git a/pkg/acceptance/compose/gss/psql/gss_test.go b/pkg/acceptance/compose/gss/psql/gss_test.go index 39532a4aac15..0ff6d26cd49c 100644 --- a/pkg/acceptance/compose/gss/psql/gss_test.go +++ b/pkg/acceptance/compose/gss/psql/gss_test.go @@ -190,7 +190,8 @@ func TestGSS(t *testing.T) { } func TestGSSFileDescriptorCount(t *testing.T) { - rootConnector, err := pq.NewConnector("user=root sslmode=require") + t.Skip("#110194") + rootConnector, err := pq.NewConnector("user=root password=rootpw sslmode=require") if err != nil { t.Fatal(err) } diff --git a/pkg/cli/BUILD.bazel b/pkg/cli/BUILD.bazel index 1feb3316daa8..a8552deb79d5 100644 --- a/pkg/cli/BUILD.bazel +++ b/pkg/cli/BUILD.bazel @@ -207,7 +207,6 @@ go_library( "//pkg/util/log/severity", "//pkg/util/netutil/addr", "//pkg/util/protoutil", - "//pkg/util/randutil", "//pkg/util/retry", "//pkg/util/sdnotify", "//pkg/util/stop", diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index ddacc121fbe8..8a0d7516c550 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -13,7 +13,6 @@ package cli import ( "context" "fmt" - "math/rand" "net" "net/http" "net/http/pprof" @@ -29,7 +28,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/log/logcrash" "github.com/cockroachdb/cockroach/pkg/util/log/severity" - "github.com/cockroachdb/cockroach/pkg/util/randutil" // intentionally not all the workloads in pkg/ccl/workloadccl/allccl _ "github.com/cockroachdb/cockroach/pkg/workload/bank" // registers workloads _ "github.com/cockroachdb/cockroach/pkg/workload/bulkingest" // registers workloads @@ -51,9 +49,6 @@ import ( // to be the body of an action package main `main` func elsewhere. It is // abstracted for reuse by duplicated `main` funcs in different distributions. func Main() { - // Seed the math/rand RNG from crypto/rand. - rand.Seed(randutil.NewPseudoSeed()) - if len(os.Args) == 1 { os.Args = append(os.Args, "help") } diff --git a/pkg/cloud/cloudcheck/cloudcheck_processor.go b/pkg/cloud/cloudcheck/cloudcheck_processor.go index 3202ec940ae9..1b063d5e4b04 100644 --- a/pkg/cloud/cloudcheck/cloudcheck_processor.go +++ b/pkg/cloud/cloudcheck/cloudcheck_processor.go @@ -12,6 +12,7 @@ package cloudcheck import ( "context" + crypto_rand "crypto/rand" "fmt" "io" "math/rand" @@ -113,7 +114,7 @@ func checkStorage( } buf := make([]byte, chunkSize) - _, _ = rand.Read(buf) + _, _ = crypto_rand.Read(buf) var res result diff --git a/pkg/cmd/bazci/BUILD.bazel b/pkg/cmd/bazci/BUILD.bazel index 3db73f7237cd..d8dcc425f578 100644 --- a/pkg/cmd/bazci/BUILD.bazel +++ b/pkg/cmd/bazci/BUILD.bazel @@ -17,7 +17,7 @@ go_library( "@com_github_cockroachdb_errors//:errors", "@com_github_gogo_protobuf//types", "@com_github_spf13_cobra//:cobra", - "@go_googleapis//google/devtools/build/v1:build_go_proto", + "@org_golang_google_genproto//googleapis/devtools/build/v1:build", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_protobuf//types/known/emptypb", ], diff --git a/pkg/cmd/roachprod/docker/Dockerfile b/pkg/cmd/roachprod/docker/Dockerfile index 88cb3ad5ef0d..ea28a9bbaea6 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.19 +FROM golang:1.20 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/main.go b/pkg/cmd/roachtest/main.go index 675c35d018e2..cd7a303fb5f0 100644 --- a/pkg/cmd/roachtest/main.go +++ b/pkg/cmd/roachtest/main.go @@ -85,7 +85,6 @@ func parseCreateOpts(flags *pflag.FlagSet, opts *vm.CreateOpts) { } func main() { - rand.Seed(timeutil.Now().UnixNano()) username := os.Getenv("ROACHPROD_USER") parallelism := 10 var cpuQuota int diff --git a/pkg/cmd/roachtest/test_runner.go b/pkg/cmd/roachtest/test_runner.go index 8cc29ea730bb..f1ce634aebfa 100644 --- a/pkg/cmd/roachtest/test_runner.go +++ b/pkg/cmd/roachtest/test_runner.go @@ -17,7 +17,6 @@ import ( "fmt" "html" "io" - "math/rand" "net" "net/http" "os" @@ -284,10 +283,6 @@ func (r *testRunner) Run( clusterAllocator = defaultClusterAllocator(r, clustersOpt, lopt) } - // Seed the default rand source so that different runs get different cluster - // IDs. - rand.Seed(timeutil.Now().UnixNano()) - n := len(tests) if n*count < parallelism { // Don't spin up more workers than necessary. diff --git a/pkg/cmd/roachtest/tests/go_helpers.go b/pkg/cmd/roachtest/tests/go_helpers.go index 99a8e27e6cc3..153b19d2d5ae 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.19.10.linux-amd64.tar.gz > /tmp/go.tgz`, + ctx, t, c, node, "download go", `curl -fsSL https://dl.google.com/go/go1.20.8.linux-amd64.tar.gz > /tmp/go.tgz`, ); err != nil { t.Fatal(err) } if err := repeatRunE( ctx, t, c, node, "verify tarball", `sha256sum -c - <