Skip to content

Commit

Permalink
*: upgrade to go 1.20.1
Browse files Browse the repository at this point in the history
* [ ] Adjust the Pebble tests to run in new version.
* [ ] Adjust version in Docker image ([source](./builder/Dockerfile)).
* [ ] Adjust version in the TeamCity agent image ([setup script](./packer/teamcity-agent.sh))
* [ ] Rebuild and push the Docker image (following [Basic Process](#basic-process))
* [ ] Update `build/teamcity/internal/release/build-and-publish-patched-go/impl.sh` with the new version and adjust SHA256 sums as necessary.
* [ ] 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.
* [ ] 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.
* [ ] Run `./dev generate bazel` to refresh `distdir_files.bzl`, then `bazel fetch @distdir//:archives` to ensure you've updated all hashes to the correct value.
* [ ] Bump the version in `builder.sh` accordingly ([source](./builder.sh#L6)).
* [ ] Bump the version in `go-version-check.sh` ([source](./go-version-check.sh)), unless bumping to a new patch release.
* [ ] Bump the go version in `go.mod`.
* [ ] Bump the default installed version of Go in `bootstrap-debian.sh` ([source](./bootstrap/bootstrap-debian.sh)).
* [ ] Replace other mentions of the older version of go (grep for `golang:<old_version>` and `go<old_version>`).
* [ ] Update the `builder.dockerImage` parameter in the TeamCity [`Cockroach`](https://teamcity.cockroachdb.com/admin/editProject.html?projectId=Cockroach&tab=projectParams) and [`Internal`](https://teamcity.cockroachdb.com/admin/editProject.html?projectId=Internal&tab=projectParams) projects.
* [ ] Ask the Developer Infrastructure team to deploy new TeamCity agent images according to [packer/README.md](./packer/README.md)

Release note (build change): upgrade to go 1.20.1
Epic: none
  • Loading branch information
healthy-pod committed Feb 28, 2023
1 parent 528cd19 commit c196dad
Show file tree
Hide file tree
Showing 61 changed files with 665 additions and 1,125 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cockroachdb/5.1.0
cockroachdb/5.4.0
84 changes: 42 additions & 42 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def go_deps():
name = "co_honnef_go_tools",
build_file_proto_mode = "disable_global",
importpath = "honnef.co/go/tools",
patch_args = ["-p1"],
patch_args = ["-p1", "-s"],
patches = [
"@com_github_cockroachdb_cockroach//build/patches:co_honnef_go_tools.patch",
],
sha256 = "9cc6be802987a1ad579e7a1d90bde4c50b9832ce9213eab302bf8916ab3dc2b7",
strip_prefix = "honnef.co/go/tools@v0.3.2",
sha256 = "2626815520502cc18e960db6de5ddf33d124ae7f1c9a379d445ea36427657539",
strip_prefix = "honnef.co/go/tools@v0.4.2",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/honnef.co/go/tools/co_honnef_go_tools-v0.3.2.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/honnef.co/go/tools/co_honnef_go_tools-v0.4.2.zip",
],
)
go_repository(
Expand Down Expand Up @@ -1048,7 +1048,7 @@ def go_deps():
name = "com_github_buchgr_bazel_remote",
build_file_proto_mode = "disable_global",
importpath = "github.com/buchgr/bazel-remote",
patch_args = ["-p1"],
patch_args = ["-p1", "-s"],
patches = [
"@com_github_cockroachdb_cockroach//build/patches:com_github_buchgr_bazel_remote.patch",
],
Expand Down Expand Up @@ -1112,10 +1112,10 @@ def go_deps():
name = "com_github_burntsushi_toml",
build_file_proto_mode = "disable_global",
importpath = "github.com/BurntSushi/toml",
sha256 = "3f2cf2328cdfac39db5ae69c84201f961b50d15792f77de0abe87089836a932c",
strip_prefix = "github.com/BurntSushi/toml@v0.4.1",
sha256 = "6fb658e8262179ffd34d57eaef6b076b25c77e8b2129659b66697cded29a7121",
strip_prefix = "github.com/BurntSushi/toml@v1.2.1",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/BurntSushi/toml/com_github_burntsushi_toml-v0.4.1.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/BurntSushi/toml/com_github_burntsushi_toml-v1.2.1.zip",
],
)
go_repository(
Expand Down Expand Up @@ -1551,7 +1551,7 @@ def go_deps():
],
build_file_proto_mode = "disable_global",
importpath = "github.com/cockroachdb/pebble",
patch_args = ["-p1"],
patch_args = ["-p1", "-s"],
patches = [
"@com_github_cockroachdb_cockroach//build/patches:com_github_cockroachdb_pebble.patch",
],
Expand Down Expand Up @@ -1605,10 +1605,10 @@ def go_deps():
name = "com_github_cockroachdb_tools",
build_file_proto_mode = "disable_global",
importpath = "github.com/cockroachdb/tools",
sha256 = "37a3737dd23768b4997b2f0341d625658f5862cdbf808f7fbf3a7f9fd25913a7",
strip_prefix = "github.com/cockroachdb/tools@v0.0.0-20211112185054-642e51449b40",
sha256 = "52f4eb9846b87b5f007d93992ad979829d1de2a7e59ad1eba65d9aaf6df0d434",
strip_prefix = "github.com/cockroachdb/tools@v0.0.0-20230222013927-64f705ca010c",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/tools/com_github_cockroachdb_tools-v0.0.0-20211112185054-642e51449b40.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/tools/com_github_cockroachdb_tools-v0.0.0-20230222013927-64f705ca010c.zip",
],
)
go_repository(
Expand Down Expand Up @@ -3536,7 +3536,7 @@ def go_deps():
name = "com_github_gogo_protobuf",
build_file_proto_mode = "disable_global",
importpath = "github.com/gogo/protobuf",
patch_args = ["-p1"],
patch_args = ["-p1", "-s"],
patches = [
"@com_github_cockroachdb_cockroach//build/patches:com_github_gogo_protobuf.patch",
],
Expand Down Expand Up @@ -3680,7 +3680,7 @@ def go_deps():
name = "com_github_golang_protobuf",
build_file_proto_mode = "disable_global",
importpath = "github.com/golang/protobuf",
patch_args = ["-p1"],
patch_args = ["-p1", "-s"],
patches = [
"@com_github_cockroachdb_cockroach//build/patches:com_github_golang_protobuf.patch",
],
Expand Down Expand Up @@ -4135,7 +4135,7 @@ def go_deps():
build_file_proto_mode = "disable_global",
build_naming_convention = "go_default_library",
importpath = "github.com/grpc-ecosystem/grpc-gateway",
patch_args = ["-p1"],
patch_args = ["-p1", "-s"],
patches = [
"@com_github_cockroachdb_cockroach//build/patches:com_github_grpc_ecosystem_grpc_gateway.patch",
],
Expand Down Expand Up @@ -5229,7 +5229,7 @@ def go_deps():
name = "com_github_kisielk_errcheck",
build_file_proto_mode = "disable_global",
importpath = "github.com/kisielk/errcheck",
patch_args = ["-p1"],
patch_args = ["-p1", "-s"],
patches = [
"@com_github_cockroachdb_cockroach//build/patches:com_github_kisielk_errcheck.patch",
],
Expand Down Expand Up @@ -5333,7 +5333,7 @@ def go_deps():
name = "com_github_knz_go_libedit",
build_file_proto_mode = "disable_global",
importpath = "github.com/knz/go-libedit",
patch_args = ["-p1"],
patch_args = ["-p1", "-s"],
patches = [
"@com_github_cockroachdb_cockroach//build/patches:com_github_knz_go_libedit.patch",
],
Expand Down Expand Up @@ -7330,7 +7330,7 @@ def go_deps():
name = "com_github_pseudomuto_protoc_gen_doc",
build_file_proto_mode = "disable_global",
importpath = "github.com/pseudomuto/protoc-gen-doc",
patch_args = ["-p1"],
patch_args = ["-p1", "-s"],
patches = [
"@com_github_cockroachdb_cockroach//build/patches:com_github_pseudomuto_protoc_gen_doc.patch",
],
Expand Down Expand Up @@ -9744,10 +9744,10 @@ def go_deps():
name = "org_golang_x_exp_typeparams",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/exp/typeparams",
sha256 = "27a9b60bc717c7882d812a302cc6e64df1617789eac7c740e331eb09877a416f",
strip_prefix = "golang.org/x/exp/typeparams@v0.0.0-20220713135740-79cabaa25d75",
sha256 = "9bd73f186851c6229484f486981f608d16e2b86acbbef6f4f7cc0480a508a4a4",
strip_prefix = "golang.org/x/exp/typeparams@v0.0.0-20221208152030-732eee02a75a",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/exp/typeparams/org_golang_x_exp_typeparams-v0.0.0-20220713135740-79cabaa25d75.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/exp/typeparams/org_golang_x_exp_typeparams-v0.0.0-20221208152030-732eee02a75a.zip",
],
)
go_repository(
Expand Down Expand Up @@ -9784,20 +9784,20 @@ def go_deps():
name = "org_golang_x_mod",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/mod",
sha256 = "24abd1db13329873d72034dc27efad09cbc37d39cf28b8ff7bb3c2adc8eedef7",
strip_prefix = "golang.org/x/mod@v0.7.0",
sha256 = "4ae8176799d8cda819e70731ba6855735003e7e4930436e34584c75c96c496e0",
strip_prefix = "golang.org/x/mod@v0.8.0",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/mod/org_golang_x_mod-v0.7.0.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/mod/org_golang_x_mod-v0.8.0.zip",
],
)
go_repository(
name = "org_golang_x_net",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/net",
sha256 = "1decf7a324a0916bc66304da1b68a834ce679379422de3a2855f3031f6dc39bd",
strip_prefix = "golang.org/x/net@v0.0.0-20220722155237-a158d28d115b",
sha256 = "7ff2f50b1f3a58833f867d1646421569a91d8c19a0999793c5af79b10c16b8b8",
strip_prefix = "golang.org/x/net@v0.6.0",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/net/org_golang_x_net-v0.0.0-20220722155237-a158d28d115b.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/net/org_golang_x_net-v0.6.0.zip",
],
)
go_repository(
Expand All @@ -9824,40 +9824,40 @@ def go_deps():
name = "org_golang_x_sync",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/sync",
sha256 = "39d2431ae1db11be34b4012b719e7bcec1572006a122d44509da038a5b498ff1",
strip_prefix = "golang.org/x/sync@v0.0.0-20220722155255-886fb9371eb4",
sha256 = "f510bec6009e19882d19953e7273137d34df86c65949345d72f123a255c2ecd2",
strip_prefix = "golang.org/x/sync@v0.1.0",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/sync/org_golang_x_sync-v0.0.0-20220722155255-886fb9371eb4.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/sync/org_golang_x_sync-v0.1.0.zip",
],
)
go_repository(
name = "org_golang_x_sys",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/sys",
sha256 = "cbdf18e3be9f211ca962684ac19d41d4be24042898ec0cc664bf8d1c2955d384",
strip_prefix = "golang.org/x/sys@v0.3.0",
sha256 = "cf47336ac1bf675fa6d6dd5ac5399b0143c513404c449fa3f3380a58123c7908",
strip_prefix = "golang.org/x/sys@v0.5.0",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/sys/org_golang_x_sys-v0.3.0.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/sys/org_golang_x_sys-v0.5.0.zip",
],
)
go_repository(
name = "org_golang_x_term",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/term",
sha256 = "3adf713afa49fe26580ffe4adb1f4fb2f4921c945301aa5a9fb6d34031fa30cd",
strip_prefix = "golang.org/x/term@v0.0.0-20210927222741-03fcf44c2211",
sha256 = "7d89c49ab41306950128a0f4b7c67fb8e2d2f637ece8e024e6cf38d17a33193b",
strip_prefix = "golang.org/x/term@v0.5.0",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/term/org_golang_x_term-v0.0.0-20210927222741-03fcf44c2211.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/term/org_golang_x_term-v0.5.0.zip",
],
)
go_repository(
name = "org_golang_x_text",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/text",
sha256 = "16af01ae1aacbb027662d39662bd52e92e288ba4ce104ea0116534a81dfd3c30",
strip_prefix = "golang.org/x/text@v0.4.0",
sha256 = "4d017493c58addadf3c753056b921b47ae386a4cfd10eab2d90ed1252c6ba0e4",
strip_prefix = "golang.org/x/text@v0.7.0",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/text/org_golang_x_text-v0.4.0.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/text/org_golang_x_text-v0.7.0.zip",
],
)
go_repository(
Expand All @@ -9874,10 +9874,10 @@ def go_deps():
name = "org_golang_x_tools",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/tools",
sha256 = "4b122e0e4703bc4014cb1cf8c014fcf93ea7d72f01da79499365346f54cbb851",
strip_prefix = "golang.org/x/tools@v0.1.12",
sha256 = "9a29c8904c2acd4b65825e916cbdaf417086f35bb68c54af9a6283a0e1341e85",
strip_prefix = "golang.org/x/tools@v0.6.0",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/tools/org_golang_x_tools-v0.1.12.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/tools/org_golang_x_tools-v0.6.0.zip",
],
)
go_repository(
Expand Down
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ docs/generated/settings/settings-for-tenants.txt: $(COCKROACHSHORT)

SETTINGS_DOC_PAGES := docs/generated/settings/settings.html docs/generated/settings/settings-for-tenants.txt

# Note: We pass `-v` to `go build` and `go test -i` so that warnings
# Note: We pass `-v` to `go build` and `go test` so that warnings
# from the linker aren't suppressed. The usage of `-v` also shows when
# dependencies are rebuilt which is useful when switching between
# normal and race test builds.
Expand Down Expand Up @@ -1223,10 +1223,7 @@ lint: ## Run all style checkers and linters.
lint: bin/returncheck bin/roachvet bin/optfmt
$(info $(yellow)[WARNING] Use `dev lint$(if $(filter . -,$(TESTS)),, --filter $(TESTS))$(if $(findstring 60m,$(TESTTIMEOUT)),, --timeout $(TESTTIMEOUT))` instead.$(term-reset))
@if [ -t 1 ]; then echo '$(yellow)NOTE: `make lint` is very slow! Perhaps `make lintshort`?$(term-reset)'; fi
@# Run 'go build -i' to ensure we have compiled object files available for all
@# packages. In Go 1.10, only 'go vet' recompiles on demand. For details:
@# https://groups.google.com/forum/#!msg/golang-dev/qfa3mHN4ZPA/X2UzjNV1BAAJ.
$(xgo) build -i -v $(GOFLAGS) -mod=vendor -tags '$(TAGS)' -ldflags '$(LINKFLAGS)' $(PKG)
$(xgo) build -v $(GOFLAGS) -mod=vendor -tags '$(TAGS)' -ldflags '$(LINKFLAGS)' $(PKG)
$(xgo) test $(GOTESTFLAGS) ./pkg/testutils/lint -v $(GOFLAGS) -mod=vendor -tags '$(TAGS)' -ldflags '$(LINKFLAGS)' -timeout $(TESTTIMEOUT) -run 'Lint/$(TESTS)'

.PHONY: lintshort
Expand Down
33 changes: 14 additions & 19 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,13 @@ workspace(
)

# Load the things that let us load other things.
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
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(
git_repository(
name = "io_bazel_rules_go",
sha256 = "f02f82e74033ea42cf81da4319b9f8e0d4c5fa49346537267bba84053dc68ceb",
strip_prefix = "cockroachdb-rules_go-993120e",
urls = [
# cockroachdb/rules_go as of 993120ee175025d8556a4dd8bec330e6c4b9ac13
# (upstream release-0.37 plus a few patches).
"https://storage.googleapis.com/public-bazel-artifacts/bazel/cockroachdb-rules_go-v0.27.0-240-g993120e.tar.gz",
],
commit = "55d80baca6ae4003b67ef3a8703ee48a70d64c6b",
remote = "https://github.com/cockroachdb/rules_go",
)

# Like the above, but for nodeJS.
Expand All @@ -50,9 +45,9 @@ http_archive(
# repo.
http_archive(
name = "bazel_gazelle",
sha256 = "5982e5463f171da99e3bdaeff8c0f48283a7a5f396ec5282910b9e8a49c0dd7e",
sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d",
urls = [
"https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel-gazelle-v0.25.0.tar.gz",
"https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel-gazelle-v0.29.0.tar.gz",
],
)

Expand Down Expand Up @@ -170,15 +165,15 @@ load(
go_download_sdk(
name = "go_sdk",
sdks = {
"darwin_amd64": ("go1.19.4.darwin-amd64.tar.gz", "e88ffbbfe3adc94c4a2cf50f24e698a4c262cd99d98ea7d02d289726106d61e7"),
"darwin_arm64": ("go1.19.4.darwin-arm64.tar.gz", "1408a938fef3d17163d585db6bc2b769835c801302e3efc05ffabe021c05f0e9"),
"freebsd_amd64": ("go1.19.4.freebsd-amd64.tar.gz", "84489ebb63f1757b79574d7345c647bd40bc6414cecb868c93e24476c2d2b9b6"),
"linux_amd64": ("go1.19.4.linux-amd64.tar.gz", "565b0c97ea85539951daf203be166aef1e96e4e1bf38498a9ef5443298d83b7a"),
"linux_arm64": ("go1.19.4.linux-arm64.tar.gz", "6bb5752483c0d145b91199e5cc1352960d926850e75864dea16282337b0d92fe"),
"windows_amd64": ("go1.19.4.windows-amd64.tar.gz", "0f37edf2a6663db33c8f67ee36e21a7eb391fbf35d494299f6a81a59e294f4a0"),
"darwin_amd64": ("go1.20.1.darwin-amd64.tar.gz", "85dcffb2e07731136d630eaa96ecbf8002cb5742b50d591edb1db352ada63ca3"),
"darwin_arm64": ("go1.20.1.darwin-arm64.tar.gz", "a89afa019a5a64b1c269b0b4276e54b133ffacf1fca2f222560d41a31a09debc"),
"freebsd_amd64": ("go1.20.1.freebsd-amd64.tar.gz", "6e124d54d5850a15fdb15754f782986f06af23c5ddb6690849417b9c74f05f98"),
"linux_amd64": ("go1.20.1.linux-amd64.tar.gz", "02411057d14f0f4c58181d43ee52891aad86fa87e552710e2336a090af061c4b"),
"linux_arm64": ("go1.20.1.linux-arm64.tar.gz", "5426a66201b233fae6ccba444b161b5c0fd828fb060a75e902e36c7601dfcee1"),
"windows_amd64": ("go1.20.1.windows-amd64.tar.gz", "e02cba8724244dba7a4891e0e08bbc15dae1fab8c23b5bc50d2a3d98613a1d34"),
},
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20230214-214430/{}"],
version = "1.19.4",
urls = ["https://storage.googleapis.com/public-bazel-artifacts/go/20230217-035753/{}"],
version = "1.20.1",
)

# To point to a local SDK path, use the following instead. We'll call the
Expand Down
3 changes: 2 additions & 1 deletion build/STRINGER.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ def stringer(src, typ, name, additional_args=[]):
cmd = """\
GO_REL_PATH=`dirname $(location @go_sdk//:bin/go)`
GO_ABS_PATH=`cd $$GO_REL_PATH && pwd`
GOCACHE_ABS=`cd $(GENDIR) && pwd`
# Set GOPATH to something to workaround https://github.com/golang/go/issues/43938
env PATH=$$GO_ABS_PATH HOME=$(GENDIR) GOPATH=/nonexist-gopath \
env PATH=$$GO_ABS_PATH GOCACHE=$$GOCACHE_ABS GOPATH=/nonexist-gopath \
$(location @com_github_cockroachdb_tools//cmd/stringer:stringer) -output=$@ -type={typ} {args} $<
""".format(
typ = typ,
Expand Down
Loading

0 comments on commit c196dad

Please sign in to comment.