From d067fe415684b4c56cc2e1d3d989e3371f8ca8aa Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 17 Aug 2024 15:30:03 +0800 Subject: [PATCH] bump Go version in go.mod, stop testing on Go 1.21 (#4633) * bump Go version in go.mod, stop testing on Go 1.21 * ci: update golangci-lint to v1.60.1 * ignore Go 1.23 0-RTT events in exhaustive linter --- .clusterfuzzlite/Dockerfile | 2 +- .github/workflows/cross-compile.yml | 2 +- .github/workflows/integration.yml | 8 ++++---- .github/workflows/lint.yml | 6 +++--- .github/workflows/unit.yml | 2 +- go.mod | 2 +- integrationtests/gomodvendor/go.mod | 4 +++- internal/handshake/crypto_setup.go | 3 +++ interop/Dockerfile | 2 +- oss-fuzz.sh | 6 +++--- 10 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.clusterfuzzlite/Dockerfile b/.clusterfuzzlite/Dockerfile index d9fedb9a5..147762f08 100644 --- a/.clusterfuzzlite/Dockerfile +++ b/.clusterfuzzlite/Dockerfile @@ -3,7 +3,7 @@ FROM gcr.io/oss-fuzz-base/base-builder-go:v1 ARG TARGETPLATFORM RUN echo "TARGETPLATFORM: ${TARGETPLATFORM}" -ENV GOVERSION=1.22.0 +ENV GOVERSION=1.23.0 RUN platform=$(echo ${TARGETPLATFORM} | tr '/' '-') && \ filename="go${GOVERSION}.${platform}.tar.gz" && \ diff --git a/.github/workflows/cross-compile.yml b/.github/workflows/cross-compile.yml index e72e12274..6bbd176fa 100644 --- a/.github/workflows/cross-compile.yml +++ b/.github/workflows/cross-compile.yml @@ -4,7 +4,7 @@ jobs: strategy: fail-fast: false matrix: - go: [ "1.21.x", "1.22.x" ] + go: [ "1.22.x", "1.23.x" ] runs-on: ${{ fromJSON(vars['CROSS_COMPILE_RUNNER_UBUNTU'] || '"ubuntu-latest"') }} name: "Cross Compilation (Go ${{matrix.go}})" timeout-minutes: 30 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 1fbf22ed3..b5d855e43 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -6,17 +6,17 @@ jobs: fail-fast: false matrix: os: [ "ubuntu" ] - go: [ "1.21.x", "1.22.x", "1.23.0-rc.2" ] + go: [ "1.22.x", "1.23.x" ] race: [ false ] include: - os: "ubuntu" - go: "1.22.x" + go: "1.23.x" race: true - os: "windows" - go: "1.21.x" + go: "1.23.x" race: false - os: "macos" - go: "1.21.x" + go: "1.23.x" race: false runs-on: ${{ fromJSON(vars[format('INTEGRATION_RUNNER_{0}', matrix.os)] || format('"{0}-latest"', matrix.os)) }} timeout-minutes: 30 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2b39852fc..a193943dd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,7 +8,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.22.x" + go-version: "1.23.x" - name: Check that no non-test files import Ginkgo or Gomega run: .github/workflows/no_ginkgo.sh - name: Check for //go:build ignore in .go files @@ -39,9 +39,9 @@ jobs: strategy: fail-fast: false matrix: - go: [ "1.21.x", "1.22.x" ] + go: [ "1.22.x", "1.23.x" ] env: - GOLANGCI_LINT_VERSION: v1.58.0 + GOLANGCI_LINT_VERSION: v1.60.1 name: golangci-lint (Go ${{ matrix.go }}) steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 2a45d5e7e..c654c06e7 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -7,7 +7,7 @@ jobs: fail-fast: false matrix: os: [ "ubuntu", "windows", "macos" ] - go: [ "1.21.x", "1.22.x", "1.23.0-rc.2" ] + go: [ "1.22.x", "1.23.x" ] runs-on: ${{ fromJSON(vars[format('UNIT_RUNNER_{0}', matrix.os)] || format('"{0}-latest"', matrix.os)) }} name: Unit tests (${{ matrix.os}}, Go ${{ matrix.go }}) timeout-minutes: 30 diff --git a/go.mod b/go.mod index 8cc39ebd2..031290e67 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/quic-go/quic-go -go 1.21 +go 1.22 require ( github.com/francoispqt/gojay v1.2.13 diff --git a/integrationtests/gomodvendor/go.mod b/integrationtests/gomodvendor/go.mod index 2594be4e7..7100b58e3 100644 --- a/integrationtests/gomodvendor/go.mod +++ b/integrationtests/gomodvendor/go.mod @@ -1,6 +1,8 @@ module test -go 1.21 +go 1.22 + +toolchain go1.22.4 // The version doesn't matter here, as we're replacing it with the currently checked out code anyway. require github.com/quic-go/quic-go v0.21.0 diff --git a/internal/handshake/crypto_setup.go b/internal/handshake/crypto_setup.go index 0fb75dc8a..c8e6cb33e 100644 --- a/internal/handshake/crypto_setup.go +++ b/internal/handshake/crypto_setup.go @@ -229,6 +229,9 @@ func (h *cryptoSetup) handleMessage(data []byte, encLevel protocol.EncryptionLev } func (h *cryptoSetup) handleEvent(ev tls.QUICEvent) (done bool, err error) { + //nolint:exhaustive + // Go 1.23 added new 0-RTT events, see https://github.com/quic-go/quic-go/issues/4272. + // We will start using these events when dropping support for Go 1.22. switch ev.Kind { case tls.QUICNoEvent: return true, nil diff --git a/interop/Dockerfile b/interop/Dockerfile index 6c34fae65..070e597e1 100644 --- a/interop/Dockerfile +++ b/interop/Dockerfile @@ -5,7 +5,7 @@ RUN echo "TARGETPLATFORM: ${TARGETPLATFORM}" RUN apt-get update && apt-get install -y wget tar git -ENV GOVERSION=1.22.0 +ENV GOVERSION=1.23.0 RUN platform=$(echo ${TARGETPLATFORM} | tr '/' '-') && \ filename="go${GOVERSION}.${platform}.tar.gz" && \ diff --git a/oss-fuzz.sh b/oss-fuzz.sh index 22a577fe1..92a57a2cc 100644 --- a/oss-fuzz.sh +++ b/oss-fuzz.sh @@ -3,12 +3,12 @@ # Install Go manually, since oss-fuzz ships with an outdated Go version. # See https://github.com/google/oss-fuzz/pull/10643. export CXX="${CXX} -lresolv" # required by Go 1.20 -wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz \ +wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz \ && mkdir temp-go \ && rm -rf /root/.go/* \ - && tar -C temp-go/ -xzf go1.22.0.linux-amd64.tar.gz \ + && tar -C temp-go/ -xzf go1.23.0.linux-amd64.tar.gz \ && mv temp-go/go/* /root/.go/ \ - && rm -rf temp-go go1.22.0.linux-amd64.tar.gz + && rm -rf temp-go go1.23.0.linux-amd64.tar.gz ( # fuzz qpack