From 55b07958666dedfc156a56edd91e76f2bf5f183e Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Wed, 6 Mar 2024 09:54:04 -0600 Subject: [PATCH] build: upgrade to go1.22 (#20066) * build: upgrade to go1.22 * add cl * build: use codecgen from go-msgpack v1.1.5+base32 and stringer 0.18.0 for compatability with go1.22 * ci: update golangci-lint to 1.56.2 * build: update hclogvet for go1.22 * build: bump to go1.22.1 --- .changelog/20066.txt | 3 +++ .go-version | 2 +- GNUmakefile | 8 ++++---- contributing/README.md | 2 +- go.mod | 4 ++-- go.sum | 7 ++++--- scripts/linux-priv-go.sh | 2 +- scripts/release/mac-remote-build | 2 +- 8 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 .changelog/20066.txt diff --git a/.changelog/20066.txt b/.changelog/20066.txt new file mode 100644 index 000000000..39f56af2a --- /dev/null +++ b/.changelog/20066.txt @@ -0,0 +1,3 @@ +```release-note:improvement +build: Update to go1.22 +``` diff --git a/.go-version b/.go-version index c262b1f0d..6245beecd 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.21.6 +1.22.1 diff --git a/GNUmakefile b/GNUmakefile index e49d0e965..5ae54b885 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -135,19 +135,19 @@ deps: ## Install build and development dependencies go install gotest.tools/gotestsum@v1.10.0 go install github.com/hashicorp/hcl/v2/cmd/hclfmt@d0c4fa8b0bbc2e4eeccd1ed2a32c2089ed8c5cf1 go install github.com/golang/protobuf/protoc-gen-go@v1.3.4 - go install github.com/hashicorp/go-msgpack/codec/codecgen@v1.1.5 + go install github.com/hashicorp/go-msgpack/codec/codecgen@v1.1.5+base32 go install github.com/bufbuild/buf/cmd/buf@v0.36.0 go install github.com/hashicorp/go-changelog/cmd/changelog-build@latest - go install golang.org/x/tools/cmd/stringer@v0.1.12 + go install golang.org/x/tools/cmd/stringer@v0.18.0 go install github.com/hashicorp/hc-install/cmd/hc-install@v0.6.1 go install github.com/shoenig/go-modtool@v0.2.0 .PHONY: lint-deps lint-deps: ## Install linter dependencies @echo "==> Updating linter dependencies..." - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.0 + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2 go install github.com/client9/misspell/cmd/misspell@v0.3.4 - go install github.com/hashicorp/go-hclog/hclogvet@v0.1.6 + go install github.com/hashicorp/go-hclog/hclogvet@v0.2.0 .PHONY: git-hooks git-dir = $(shell git rev-parse --git-dir) diff --git a/contributing/README.md b/contributing/README.md index 30baf14ab..4235abd15 100644 --- a/contributing/README.md +++ b/contributing/README.md @@ -30,7 +30,7 @@ A development environment is supplied via Vagrant to make getting started easier Developing without Vagrant --- -1. Install [Go 1.21.6+](https://golang.org/) *(Note: `gcc-go` is not supported)* +1. Install [Go 1.22.1+](https://golang.org/) *(Note: `gcc-go` is not supported)* 1. Clone this repo ```sh $ git clone https://github.com/hashicorp/nomad.git diff --git a/go.mod b/go.mod index cfa2affc6..53a2593d9 100644 --- a/go.mod +++ b/go.mod @@ -61,7 +61,7 @@ require ( github.com/hashicorp/go-immutable-radix/v2 v2.1.0 github.com/hashicorp/go-kms-wrapping/v2 v2.0.15 github.com/hashicorp/go-memdb v1.3.4 - github.com/hashicorp/go-msgpack v1.1.5 + github.com/hashicorp/go-msgpack v1.1.6-0.20240304204939-8824e8ccc35f github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-netaddrs v0.1.0 github.com/hashicorp/go-plugin v1.6.0 @@ -282,7 +282,7 @@ require ( golang.org/x/tools v0.14.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.126.0 // indirect - google.golang.org/appengine v1.6.7 // indirect + google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect diff --git a/go.sum b/go.sum index 72489b26e..1f00d7a0a 100644 --- a/go.sum +++ b/go.sum @@ -654,8 +654,8 @@ github.com/hashicorp/go-memdb v1.3.4 h1:XSL3NR682X/cVk2IeV0d70N4DZ9ljI885xAEU8Io github.com/hashicorp/go-memdb v1.3.4/go.mod h1:uBTr1oQbtuMgd1SSGoR8YV27eT3sBHbYiNm53bMpgSg= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-msgpack v1.1.5 h1:9byZdVjKTe5mce63pRVNP1L7UAmdHOTEMGehn6KvJWs= -github.com/hashicorp/go-msgpack v1.1.5/go.mod h1:gWVc3sv/wbDmR3rQsj1CAktEZzoz1YNK9NfGLXJ69/4= +github.com/hashicorp/go-msgpack v1.1.6-0.20240304204939-8824e8ccc35f h1:/xqzTen8ftnKv3cKa87WEoOLtsDJYFU0ArjrKaPTTkc= +github.com/hashicorp/go-msgpack v1.1.6-0.20240304204939-8824e8ccc35f/go.mod h1:gWVc3sv/wbDmR3rQsj1CAktEZzoz1YNK9NfGLXJ69/4= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= @@ -1549,8 +1549,9 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= diff --git a/scripts/linux-priv-go.sh b/scripts/linux-priv-go.sh index ddc9cdcae..e7ab52594 100755 --- a/scripts/linux-priv-go.sh +++ b/scripts/linux-priv-go.sh @@ -21,7 +21,7 @@ case $(arch) in esac function install_go() { - local go_version="1.21.6" + local go_version="1.22.1" local download="https://storage.googleapis.com/golang/go${go_version}.linux-${ARCH}.tar.gz" if go version 2>&1 | grep -q "${go_version}"; then diff --git a/scripts/release/mac-remote-build b/scripts/release/mac-remote-build index 91770e18b..8ac321ee5 100755 --- a/scripts/release/mac-remote-build +++ b/scripts/release/mac-remote-build @@ -56,7 +56,7 @@ REPO_PATH="${TMP_WORKSPACE}/gopath/src/github.com/hashicorp/nomad" mkdir -p "${TMP_WORKSPACE}/tmp" install_go() { - local go_version="1.21.6" + local go_version="1.22.1" local download= download="https://storage.googleapis.com/golang/go${go_version}.darwin-amd64.tar.gz"