From 17e482d22dfc2436a5dec2ad0126b2235ee63742 Mon Sep 17 00:00:00 2001 From: Rootul P Date: Thu, 29 Feb 2024 20:43:25 -0500 Subject: [PATCH] chore: upgrade to Go 1.22 (#1250) Closes https://github.com/celestiaorg/celestia-core/issues/1248 --- .github/workflows/check-generated.yml | 2 +- .github/workflows/coverage.yml | 6 +++--- .github/workflows/e2e-manual.yml | 2 +- .github/workflows/e2e-nightly-34x.yml | 2 +- .github/workflows/e2e.yml | 2 +- .github/workflows/fuzz-nightly.yml | 2 +- .github/workflows/govulncheck.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/pre-release.yml | 2 +- .github/workflows/release-version.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/tests.yml | 4 ++-- DOCKER/Dockerfile | 2 +- README.md | 2 +- go.mod | 2 +- scripts/proto-gen.sh | 2 +- test/docker/Dockerfile | 2 +- test/e2e/docker/Dockerfile | 2 +- 18 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index f4fc12d786..58525bf67e 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -43,7 +43,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: "1.21.5" + go-version: "1.22" - uses: actions/checkout@v3 with: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3fca28cc3d..010f43c259 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: "1.21.5" + go-version: "1.22" - name: Create a file with all the pkgs run: go list ./... > pkgs.txt - name: Split pkgs into 4 files @@ -48,7 +48,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: "1.21.5" + go-version: "1.22" - uses: actions/checkout@v3 - uses: technote-space/get-diff-action@v6 with: @@ -70,7 +70,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: "1.21.5" + go-version: "1.22" - uses: actions/checkout@v3 - uses: technote-space/get-diff-action@v6 with: diff --git a/.github/workflows/e2e-manual.yml b/.github/workflows/e2e-manual.yml index 7d0a8ce688..8e83db9140 100644 --- a/.github/workflows/e2e-manual.yml +++ b/.github/workflows/e2e-manual.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: '1.21.5' + go-version: '1.22' - uses: actions/checkout@v3 diff --git a/.github/workflows/e2e-nightly-34x.yml b/.github/workflows/e2e-nightly-34x.yml index dc862b84ae..90763bf680 100644 --- a/.github/workflows/e2e-nightly-34x.yml +++ b/.github/workflows/e2e-nightly-34x.yml @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: '1.21.5' + go-version: '1.22' - uses: actions/checkout@v3 with: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a0d3c1ad3a..08a97b9e85 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: '1.21.5' + go-version: '1.22' - uses: actions/checkout@v3 - uses: technote-space/get-diff-action@v6 with: diff --git a/.github/workflows/fuzz-nightly.yml b/.github/workflows/fuzz-nightly.yml index 56eec898ca..468b12aea2 100644 --- a/.github/workflows/fuzz-nightly.yml +++ b/.github/workflows/fuzz-nightly.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: '1.21.5' + go-version: '1.22' - uses: actions/checkout@v3 diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index 424ecddf92..04a3377e93 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: "1.21.5" + go-version: "1.22" - uses: actions/checkout@v3 - uses: technote-space/get-diff-action@v6 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2971c843dd..52cea25d7f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21.5' + go-version: '1.22' - uses: technote-space/get-diff-action@v6 with: PATTERNS: | diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 74f3a9df86..45d1d6e14c 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: '1.21.5' + go-version: '1.22' # Similar check to ./release-version.yml, but enforces this when pushing # tags. The ./release-version.yml check can be bypassed and is mainly diff --git a/.github/workflows/release-version.yml b/.github/workflows/release-version.yml index 6e75c2e6c0..4f620ea24f 100644 --- a/.github/workflows/release-version.yml +++ b/.github/workflows/release-version.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: '1.21.5' + go-version: '1.22' - name: Check version run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d2c7fbc7f3..d616cbfcda 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: '1.21.5' + go-version: '1.22' - name: Generate release notes run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3c0dd097cb..1c0e558d92 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: "1.21.5" + go-version: "1.22" - uses: actions/checkout@v3 - uses: technote-space/get-diff-action@v6 with: @@ -58,7 +58,7 @@ jobs: # steps: # - uses: actions/setup-go@v3 # with: - # go-version: "1.21.5" + # go-version: "1.22" # - uses: actions/checkout@v3 # - uses: technote-space/get-diff-action@v6 # with: diff --git a/DOCKER/Dockerfile b/DOCKER/Dockerfile index f7f3007ecd..a5188db391 100644 --- a/DOCKER/Dockerfile +++ b/DOCKER/Dockerfile @@ -1,6 +1,6 @@ # Use a build arg to ensure that both stages use the same, # hopefully current, go version. -ARG GOLANG_BASE_IMAGE=golang:1.21.5-alpine +ARG GOLANG_BASE_IMAGE=golang:1.22-alpine # stage 1 Generate CometBFT Binary FROM --platform=$BUILDPLATFORM $GOLANG_BASE_IMAGE as builder diff --git a/README.md b/README.md index 72ff0c93eb..f625fb496f 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ This repo intends on preserving the minimal possible diff with [cometbft/cometbf - **specific to Celestia**: consider if [celestia-app](https://github.com/celestiaorg/celestia-app) is a better target - **not specific to Celestia**: consider making the contribution upstream in CometBFT -1. [Install Go](https://go.dev/doc/install) 1.21.5 +1. [Install Go](https://go.dev/doc/install) 1.22+ 2. Fork this repo 3. Clone your fork 4. Find an issue to work on (see [good first issues](https://github.com/celestiaorg/celestia-core/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)) diff --git a/go.mod b/go.mod index cc74831366..b3ea1e7067 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/cometbft/cometbft -go 1.21.5 +go 1.22 require ( github.com/BurntSushi/toml v1.2.1 diff --git a/scripts/proto-gen.sh b/scripts/proto-gen.sh index aa910af13b..0420088fd3 100755 --- a/scripts/proto-gen.sh +++ b/scripts/proto-gen.sh @@ -10,7 +10,7 @@ cd "$(git rev-parse --show-toplevel)" # Run inside Docker to install the correct versions of the required tools # without polluting the local system. -docker run --rm -i -v "$PWD":/w --workdir=/w golang:1.21.5-alpine sh <<"EOF" +docker run --rm -i -v "$PWD":/w --workdir=/w golang:1.22-alpine sh <<"EOF" apk add git make go install github.com/bufbuild/buf/cmd/buf diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile index 80c722c1ef..1d3a685b2c 100644 --- a/test/docker/Dockerfile +++ b/test/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.5 +FROM golang:1.22 # Grab deps (jq, hexdump, xxd, killall) RUN apt-get update && \ diff --git a/test/e2e/docker/Dockerfile b/test/e2e/docker/Dockerfile index 356cfe4b0a..9e53e2e48c 100644 --- a/test/e2e/docker/Dockerfile +++ b/test/e2e/docker/Dockerfile @@ -1,7 +1,7 @@ # We need to build in a Linux environment to support C libraries, e.g. RocksDB. # We use Debian instead of Alpine, so that we can use binary database packages # instead of spending time compiling them. -FROM golang:1.21.5-bullseye +FROM golang:1.22-bullseye RUN apt-get -qq update -y && apt-get -qq upgrade -y >/dev/null RUN apt-get -qq install -y libleveldb-dev librocksdb-dev >/dev/null