From fffa545e60b462f54a493ee2866aa9e3c9506ec0 Mon Sep 17 00:00:00 2001 From: Oliver Tan Date: Fri, 26 Jun 2020 17:17:30 -0700 Subject: [PATCH] build: upgrade to Go 1.14 Minor fixes required: * Upgrade go.mod to prevent build.Import errors. * Updated instructions to upgrade Go. * Updated .pb.go files - these are tied with the gofmt of the environment and we cannot fix this. * Update storage use cast DBSlice to DBString or it fails S1016 of staticcheck. * Make lint fail if the import directory is not found. * Fix acceptance test to include GOROOT or else build.Import fails from within the acceptance tests. The acceptance test is weirdly set up to run a Go binary from the outside container. Checklist: * [x] Adjust version in Docker image ([source](./builder/Dockerfile#L199-L200)). * [x] Rebuild the Docker image and bump the `version` in `builder.sh` accordingly ([source](./builder.sh#L6)). * [x] Bump the version in `go-version-check.sh` ([source](./go-version-check.sh)), unless bumping to a new patch release. * [x] Bump the default installed version of Go in `bootstrap-debian.sh` ([source](./bootstrap/bootstrap-debian.sh#L40-42)). * [ ] 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. (I will do the last step after this has merged) Release note (general change): Bump the Go version to 1.14. --- build/README.md | 12 ++++++++---- build/bootstrap/bootstrap-debian.sh | 4 ++-- build/builder.sh | 2 +- build/builder/Dockerfile | 4 ++-- build/go-version-check.sh | 3 +-- build/teamcity-acceptance.sh | 2 +- build/teamcity-verify-archive.sh | 2 +- go.mod | 2 +- pkg/acceptance/compose/gss/psql/Dockerfile | 2 +- pkg/ccl/storageccl/engineccl/rocksdb.go | 2 +- pkg/cmd/roachprod/docker/Dockerfile | 2 +- pkg/storage/enginepb/mvcc3.pb.go | 4 +++- pkg/storage/rocksdb.go | 4 ++-- pkg/testutils/lint/lint_test.go | 2 +- pkg/util/hlc/timestamp.pb.go | 4 +++- vendor | 2 +- 16 files changed, 30 insertions(+), 23 deletions(-) diff --git a/build/README.md b/build/README.md index 0becf8344394..bb1db7a9d63f 100644 --- a/build/README.md +++ b/build/README.md @@ -66,10 +66,14 @@ which may or may not work (and are not officially supported). Please copy this checklist (based on [Basic Process](#basic-process)) into the relevant commit message, with a link back to this document and perform these steps: +* [ ] Adjust the Pebble tests to run in 1.14. * [ ] Adjust version in Docker image ([source](./builder/Dockerfile#L199-L200)). -* [ ] Rebuild the Docker image and bump the `version` in `builder.sh` accordingly ([source](./builder.sh#L6)). +* [ ] Rebuild and push the Docker image (following [Basic Process](#basic-process)) +* [ ] 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`. You may also need to rerun `make vendor_rebuild` if vendoring has changed. * [ ] Bump the default installed version of Go in `bootstrap-debian.sh` ([source](./bootstrap/bootstrap-debian.sh#L40-42)). +* [ ] Replace other mentions of the older version of go (grep for `golang:` and `go`). * [ ] 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. You can test the new builder image in TeamCity by using the custom parameters @@ -94,14 +98,14 @@ When updating a dependency, you should run `go mod tidy` after `go get` to ensur are removed from go.sum. You must then run `make vendor_rebuild` to ensure the modules are installed. These changes must -then be committed in the submodule directory (see Working with Submodules). +then be committed in the submodule directory (see [Working with Submodules](#working-with-submodules)). Programs can then be run using `go build -mod=vendor ...` or `go test -mod=vendor ...`. ### Removing a dependency -When a dependency has been removed, run `go mod tidy` and then `make vendor_rebuild`. Then follow -the Working with Submodules steps below. +When a dependency has been removed, run `go mod tidy` and then `make vendor_rebuild`. +Then follow the [Working with Submodules](#working-with-submodules) steps. ### Requiring a new tool diff --git a/build/bootstrap/bootstrap-debian.sh b/build/bootstrap/bootstrap-debian.sh index fa28cdcc0166..90d911292abd 100755 --- a/build/bootstrap/bootstrap-debian.sh +++ b/build/bootstrap/bootstrap-debian.sh @@ -46,9 +46,9 @@ sudo tar -C /usr -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.13.9.linux-amd64.tar.gz > /tmp/go.tgz +curl -fsSL https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz > /tmp/go.tgz sha256sum -c - <