From 6025911eabff09ce6e6ee52e422b615029129311 Mon Sep 17 00:00:00 2001 From: Andrei Aaron Date: Tue, 19 Mar 2024 15:11:37 +0000 Subject: [PATCH 1/2] chore: update to go 1.22 Only go toolchain version is updated. We compile with go 1.22, but we allow others to compile using language version 1.21 if they wish to. If we also updated the go version in go.mod everyone would be forced to update, as that is enforced as a minimum allowed version. This comment explains the difference well enough https://news.ycombinator.com/item?id=36455759 Signed-off-by: Andrei Aaron --- .github/workflows/benchmark.yaml | 2 +- .github/workflows/branch-cov.yaml | 2 +- .github/workflows/build.yaml | 2 +- .github/workflows/cloc.yaml | 2 +- .github/workflows/cluster.yaml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/compare-binary-size.yaml | 2 +- .github/workflows/ecosystem-tools.yaml | 2 +- .github/workflows/gc-stress-test.yaml | 8 ++++---- .github/workflows/golangci-lint.yaml | 2 +- .github/workflows/gqlgen.yaml | 2 +- .github/workflows/license.yaml | 2 +- .github/workflows/nightly.yaml | 10 +++++----- .github/workflows/oci-conformance-action.yaml | 4 ++-- .github/workflows/sync-3rdparty-images.yaml | 2 +- .github/workflows/test.yaml | 8 ++++---- .github/workflows/tls.yaml | 2 +- .github/workflows/web-scan.yaml | 2 +- build/Dockerfile | 2 +- build/Dockerfile-conformance | 2 +- build/Dockerfile-minimal | 2 +- build/Dockerfile-zb | 2 +- build/Dockerfile-zxp | 2 +- build/stacker-conformance.yaml | 2 +- build/stacker-minimal.yaml | 2 +- build/stacker-zb.yaml | 2 +- build/stacker-zxp.yaml | 2 +- build/stacker.yaml | 2 +- go.mod | 2 +- 29 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index bee0b9892..80093089a 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x # Run benchmark with `go test -bench` and stores the output to a file - name: Run benchmark run: make BENCH_OUTPUT=ci-cd run-bench diff --git a/.github/workflows/branch-cov.yaml b/.github/workflows/branch-cov.yaml index f186dfd09..84733a4ec 100644 --- a/.github/workflows/branch-cov.yaml +++ b/.github/workflows/branch-cov.yaml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Install dependencies run: | cd $GITHUB_WORKSPACE diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6c225264c..78ca90bc2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,7 +30,7 @@ jobs: uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Cache go dependencies id: cache-go-dependencies uses: actions/cache@v4 diff --git a/.github/workflows/cloc.yaml b/.github/workflows/cloc.yaml index e7f51c4a9..bdf7bc542 100644 --- a/.github/workflows/cloc.yaml +++ b/.github/workflows/cloc.yaml @@ -21,7 +21,7 @@ jobs: uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Check out source code uses: actions/checkout@v4 - name: Install dependencies diff --git a/.github/workflows/cluster.yaml b/.github/workflows/cluster.yaml index 61dc8b49c..7fab7293b 100644 --- a/.github/workflows/cluster.yaml +++ b/.github/workflows/cluster.yaml @@ -31,7 +31,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Install dependencies run: | cd $GITHUB_WORKSPACE diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d3903e528..70ff4e34c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -49,7 +49,7 @@ jobs: uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/compare-binary-size.yaml b/.github/workflows/compare-binary-size.yaml index a6a87ece8..b57f3a15a 100644 --- a/.github/workflows/compare-binary-size.yaml +++ b/.github/workflows/compare-binary-size.yaml @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Checkout zot (main branch) run: | mkdir -p $GITHUB_WORKSPACE/zot_main diff --git a/.github/workflows/ecosystem-tools.yaml b/.github/workflows/ecosystem-tools.yaml index 5b9ccd49c..89ced4d7a 100644 --- a/.github/workflows/ecosystem-tools.yaml +++ b/.github/workflows/ecosystem-tools.yaml @@ -20,7 +20,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Install dependencies run: | cd $GITHUB_WORKSPACE diff --git a/.github/workflows/gc-stress-test.yaml b/.github/workflows/gc-stress-test.yaml index 6371eccfb..36fd324e8 100644 --- a/.github/workflows/gc-stress-test.yaml +++ b/.github/workflows/gc-stress-test.yaml @@ -20,7 +20,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Run zb id: bench @@ -51,7 +51,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Run zb id: bench @@ -82,7 +82,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - uses: ./.github/actions/setup-localstack - name: Setup minio service run: | @@ -157,7 +157,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - uses: ./.github/actions/setup-localstack - name: Setup minio service run: | diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 477ff06dc..421af1988 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: '1.21' + go-version: '1.22' - uses: actions/checkout@v4 - name: Run linter with GH action uses: golangci/golangci-lint-action@v4 diff --git a/.github/workflows/gqlgen.yaml b/.github/workflows/gqlgen.yaml index e2445894d..fa15c4377 100644 --- a/.github/workflows/gqlgen.yaml +++ b/.github/workflows/gqlgen.yaml @@ -25,7 +25,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Install dependencies run: | cd $GITHUB_WORKSPACE diff --git a/.github/workflows/license.yaml b/.github/workflows/license.yaml index e64609297..47967ba4b 100644 --- a/.github/workflows/license.yaml +++ b/.github/workflows/license.yaml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Install go-licenses run: go install github.com/google/go-licenses@latest - name: Check for forbidden licenses diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index db863becd..7034af521 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.22.x - name: Install dependencies run: | cd $GITHUB_WORKSPACE @@ -67,7 +67,7 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.22.x - name: Install dependencies run: | cd $GITHUB_WORKSPACE @@ -85,7 +85,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - uses: ./.github/actions/setup-localstack - name: Run zb @@ -122,7 +122,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - uses: ./.github/actions/setup-localstack - name: Run zb @@ -170,7 +170,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.22.x - name: Install dependencies run: | cd $GITHUB_WORKSPACE diff --git a/.github/workflows/oci-conformance-action.yaml b/.github/workflows/oci-conformance-action.yaml index 9fab66cbe..f1e0fd5af 100644 --- a/.github/workflows/oci-conformance-action.yaml +++ b/.github/workflows/oci-conformance-action.yaml @@ -20,11 +20,11 @@ jobs: runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: Install go 1.21 + - name: Install go 1.22 uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Checkout this PR uses: actions/checkout@v4 - name: Start zot server diff --git a/.github/workflows/sync-3rdparty-images.yaml b/.github/workflows/sync-3rdparty-images.yaml index 3ac325d08..c2f3b7153 100644 --- a/.github/workflows/sync-3rdparty-images.yaml +++ b/.github/workflows/sync-3rdparty-images.yaml @@ -18,7 +18,7 @@ jobs: strategy: matrix: golang_version: - - "1.21" + - "1.22" runs-on: ubuntu-latest steps: - name: Log in to GitHub Docker Registry diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9172278ad..da76edf18 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,7 +21,7 @@ jobs: uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Cache go dependencies id: cache-go-dependencies uses: actions/cache@v4 @@ -60,7 +60,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Cache go dependencies id: cache-go-dependencies uses: actions/cache@v4 @@ -99,7 +99,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Cache go dependencies id: cache-go-dependencies uses: actions/cache@v4 @@ -133,7 +133,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: download all workflow coverage files uses: actions/download-artifact@v4 - name: merge code coverage diff --git a/.github/workflows/tls.yaml b/.github/workflows/tls.yaml index 54fa1803e..e8521f36f 100644 --- a/.github/workflows/tls.yaml +++ b/.github/workflows/tls.yaml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Install dependencies run: | cd $GITHUB_WORKSPACE diff --git a/.github/workflows/web-scan.yaml b/.github/workflows/web-scan.yaml index 743f9d3a6..af8ef74cd 100644 --- a/.github/workflows/web-scan.yaml +++ b/.github/workflows/web-scan.yaml @@ -25,7 +25,7 @@ jobs: uses: actions/setup-go@v5 with: cache: false - go-version: 1.21.x + go-version: 1.22.x - name: Checkout uses: actions/checkout@v4 - name: Build zot diff --git a/build/Dockerfile b/build/Dockerfile index 3ad14a985..b5a19bd61 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,7 +1,7 @@ # --- # Stage 1: Install certs, build binary, create default config file # --- -FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.21 AS builder +FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.22 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/build/Dockerfile-conformance b/build/Dockerfile-conformance index 71cf74253..6878935cf 100644 --- a/build/Dockerfile-conformance +++ b/build/Dockerfile-conformance @@ -1,7 +1,7 @@ # --- # Stage 1: Install certs, build binary, create default config file # --- -FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.21 AS builder +FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.22 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/build/Dockerfile-minimal b/build/Dockerfile-minimal index f2c477b18..789bcca68 100644 --- a/build/Dockerfile-minimal +++ b/build/Dockerfile-minimal @@ -1,7 +1,7 @@ # --- # Stage 1: Install certs, build binary, create default config file # --- -FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.21 AS builder +FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.22 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/build/Dockerfile-zb b/build/Dockerfile-zb index f8f0d0b8a..34ea763e3 100644 --- a/build/Dockerfile-zb +++ b/build/Dockerfile-zb @@ -1,7 +1,7 @@ # --- # Stage 1: Install certs, build binary, create default config file # --- -FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.21 AS builder +FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.22 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/build/Dockerfile-zxp b/build/Dockerfile-zxp index 75a39439a..b37db0332 100644 --- a/build/Dockerfile-zxp +++ b/build/Dockerfile-zxp @@ -1,7 +1,7 @@ # --- # Stage 1: Build binary, create default config file # --- -FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.21 AS builder +FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.22 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/build/stacker-conformance.yaml b/build/stacker-conformance.yaml index d2cf15b50..bc9ae65f3 100644 --- a/build/stacker-conformance.yaml +++ b/build/stacker-conformance.yaml @@ -1,7 +1,7 @@ build: from: type: docker - url: docker://ghcr.io/project-zot/golang:1.21 + url: docker://ghcr.io/project-zot/golang:1.22 binds: - ../. -> /zotcopy run: | diff --git a/build/stacker-minimal.yaml b/build/stacker-minimal.yaml index c536d33a9..bcb1cfd35 100644 --- a/build/stacker-minimal.yaml +++ b/build/stacker-minimal.yaml @@ -1,7 +1,7 @@ build: from: type: docker - url: docker://ghcr.io/project-zot/golang:1.21 + url: docker://ghcr.io/project-zot/golang:1.22 binds: - ../. -> /zotcopy run: | diff --git a/build/stacker-zb.yaml b/build/stacker-zb.yaml index 951ed72ec..cb97dd7fe 100644 --- a/build/stacker-zb.yaml +++ b/build/stacker-zb.yaml @@ -1,7 +1,7 @@ build: from: type: docker - url: docker://ghcr.io/project-zot/golang:1.21 + url: docker://ghcr.io/project-zot/golang:1.22 binds: - ../. -> /zotcopy run: | diff --git a/build/stacker-zxp.yaml b/build/stacker-zxp.yaml index 2b533f68d..ffeb4f302 100644 --- a/build/stacker-zxp.yaml +++ b/build/stacker-zxp.yaml @@ -1,7 +1,7 @@ build: from: type: docker - url: docker://ghcr.io/project-zot/golang:1.21 + url: docker://ghcr.io/project-zot/golang:1.22 binds: - ../. -> /zotcopy run: | diff --git a/build/stacker.yaml b/build/stacker.yaml index f7345791b..c989ad754 100644 --- a/build/stacker.yaml +++ b/build/stacker.yaml @@ -1,7 +1,7 @@ build: from: type: docker - url: docker://ghcr.io/project-zot/golang:1.21 + url: docker://ghcr.io/project-zot/golang:1.22 binds: - ../. -> /zotcopy run: | diff --git a/go.mod b/go.mod index d241692f4..4d4b3a8b3 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module zotregistry.dev/zot go 1.21 -toolchain go1.21.4 +toolchain go1.22.1 require ( github.com/99designs/gqlgen v0.17.45 From 6d0efeb9e08b415f8170dd6471f8118a3ab7e88a Mon Sep 17 00:00:00 2001 From: Andrei Aaron Date: Tue, 19 Mar 2024 17:04:15 +0000 Subject: [PATCH 2/2] chore: fix freeBSD AMD64 build Looks like they made some cleanup in the logic allowing buildmode pie on various platforms. Related to https://github.com/golang/go/issues/31544 See the code at: https://cs.opensource.google/go/go/+/master:src/internal/platform/supported.go;l=222-231;drc=d7fcb5cf80953f1d63246f1ae9defa60c5ce2d76;bpv=1;bpt=0 Signed-off-by: Andrei Aaron --- Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4415b2eb0..13e89e6ee 100644 --- a/Makefile +++ b/Makefile @@ -55,12 +55,11 @@ BENCH_OUTPUT ?= stdout ALL_EXTENSIONS = debug,imagetrust,lint,metrics,mgmt,profile,scrub,search,sync,ui,userprefs EXTENSIONS ?= sync,search,scrub,metrics,lint,ui,mgmt,profile,userprefs,imagetrust UI_DEPENDENCIES := search,mgmt,userprefs -# freebsd/arm64 not supported for pie builds +# freebsd is not supported for pie builds if CGO is disabled +# see supported platforms at https://cs.opensource.google/go/go/+/master:src/internal/platform/supported.go;l=222-231;drc=d7fcb5cf80953f1d63246f1ae9defa60c5ce2d76 BUILDMODE_FLAGS := -buildmode=pie ifeq ($(OS),freebsd) - ifeq ($(ARCH),arm64) - BUILDMODE_FLAGS= - endif + BUILDMODE_FLAGS= endif comma:= , space := $(null) #