From fef78c102407c77b5d5aa4c5b164c9a093bb76af Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Wed, 24 Apr 2024 21:34:41 +0900 Subject: [PATCH 1/3] install-runc: pin Go to 1.21 runc is incompatible with Go 1.22 on glibc-based distros (opencontainers/runc issue 4233) Signed-off-by: Akihiro Suda --- script/setup/install-runc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/script/setup/install-runc b/script/setup/install-runc index 07a3be7c8..6bdd023ce 100755 --- a/script/setup/install-runc +++ b/script/setup/install-runc @@ -34,11 +34,18 @@ function install_runc() { : "${RUNC_REPO:=https://github.com/opencontainers/runc.git}" TMPROOT=$(mktemp -d) + # runc is incompatible with Go 1.22 on glibc-based distros + # https://github.com/opencontainers/runc/issues/4233 + GO121DIR="${TMPROOT}"/go121 + mkdir -p "${GO121DIR}" + GOBIN="${GO121DIR}" go install golang.org/dl/go1.21.9@latest + GO121="${GO121DIR}"/go1.21.9 + $GO121 download git clone "${RUNC_REPO}" "${TMPROOT}"/runc pushd "${TMPROOT}"/runc git checkout "${RUNC_VERSION}" - make BUILDTAGS='seccomp' runc - $SUDO make install + make GO=$GO121 BUILDTAGS='seccomp' runc + $SUDO make GO=$GO121 install popd rm -fR "${TMPROOT}" } From 2d5689434d65f9d415d3aaefcea13800ce5421d2 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Fri, 29 Mar 2024 22:45:03 +0900 Subject: [PATCH 2/3] CI: use Go 1.22 by default Signed-off-by: Akihiro Suda --- .github/actions/install-go/action.yml | 2 +- .github/workflows/release.yml | 2 +- Vagrantfile | 2 +- contrib/Dockerfile.test | 2 +- contrib/fuzz/oss_fuzz_build.sh | 4 ++-- script/setup/prepare_env_windows.ps1 | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/actions/install-go/action.yml b/.github/actions/install-go/action.yml index d24bf751d..aa1593fdc 100644 --- a/.github/actions/install-go/action.yml +++ b/.github/actions/install-go/action.yml @@ -3,7 +3,7 @@ description: "Reusable action to install Go, so there is one place to bump Go ve inputs: go-version: required: true - default: "1.21.9" + default: "1.22.2" description: "Go version to install" runs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 702d933f8..fdb242d72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ on: name: Release env: - GO_VERSION: "1.21.9" + GO_VERSION: "1.22.2" permissions: # added using https://github.com/step-security/secure-workflows contents: read diff --git a/Vagrantfile b/Vagrantfile index 0a51ee51b..e33c5c237 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -104,7 +104,7 @@ EOF config.vm.provision "install-golang", type: "shell", run: "once" do |sh| sh.upload_path = "/tmp/vagrant-install-golang" sh.env = { - 'GO_VERSION': ENV['GO_VERSION'] || "1.21.9", + 'GO_VERSION': ENV['GO_VERSION'] || "1.22.2", } sh.inline = <<~SHELL #!/usr/bin/env bash diff --git a/contrib/Dockerfile.test b/contrib/Dockerfile.test index bdaa045dd..724e2912d 100644 --- a/contrib/Dockerfile.test +++ b/contrib/Dockerfile.test @@ -29,7 +29,7 @@ # docker run --privileged containerd-test # ------------------------------------------------------------------------------ -ARG GOLANG_VERSION=1.21.9 +ARG GOLANG_VERSION=1.22.2 ARG GOLANG_IMAGE=golang FROM ${GOLANG_IMAGE}:${GOLANG_VERSION} AS golang diff --git a/contrib/fuzz/oss_fuzz_build.sh b/contrib/fuzz/oss_fuzz_build.sh index efc515011..10d02f968 100755 --- a/contrib/fuzz/oss_fuzz_build.sh +++ b/contrib/fuzz/oss_fuzz_build.sh @@ -43,11 +43,11 @@ go run main.go $SRC/containerd/images apt-get update && apt-get install -y wget cd $SRC -wget --quiet https://go.dev/dl/go1.21.9.linux-amd64.tar.gz +wget --quiet https://go.dev/dl/go1.22.2.linux-amd64.tar.gz mkdir temp-go rm -rf /root/.go/* -tar -C temp-go/ -xzf go1.21.9.linux-amd64.tar.gz +tar -C temp-go/ -xzf go1.22.2.linux-amd64.tar.gz mv temp-go/go/* /root/.go/ cd $SRC/containerd diff --git a/script/setup/prepare_env_windows.ps1 b/script/setup/prepare_env_windows.ps1 index d529f3418..1ea809eac 100644 --- a/script/setup/prepare_env_windows.ps1 +++ b/script/setup/prepare_env_windows.ps1 @@ -5,7 +5,7 @@ # lived test environment. Set-MpPreference -DisableRealtimeMonitoring:$true -$PACKAGES= @{ mingw = "10.2.0"; git = ""; golang = "1.21.9"; make = ""; nssm = "" } +$PACKAGES= @{ mingw = "10.2.0"; git = ""; golang = "1.22.2"; make = ""; nssm = "" } Write-Host "Downloading chocolatey package" curl.exe -L "https://packages.chocolatey.org/chocolatey.0.10.15.nupkg" -o 'c:\choco.zip' From 15782881ee49463adcd2e65e91973ebe379f65f9 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Tue, 23 Apr 2024 10:41:40 +0900 Subject: [PATCH 3/3] go.mod: go 1.22 Depended by k8s.io/cri-api >= v0.30.0 (Kubernetes v1.30, PR 10019) https://github.com/kubernetes/cri-api/blob/v0.30.0/go.mod#L5 Signed-off-by: Akihiro Suda --- BUILDING.md | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index e9cb98660..c6f4f1a06 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -25,7 +25,7 @@ A codespace will open in a web-based version of Visual Studio Code. The [dev con To build the `containerd` daemon, and the `ctr` simple test client, the following build system dependencies are required: -* Go 1.21.x or above +* Go 1.22.x or above * Protoc 3.x compiler and headers (download at the [Google protobuf releases page](https://github.com/protocolbuffers/protobuf/releases)) * Btrfs headers and libraries for your distribution. Note that building the btrfs driver can be disabled via the build tag `no_btrfs`, removing this dependency. diff --git a/go.mod b/go.mod index 084bf8e9f..6a27bf1df 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/containerd/containerd/v2 -go 1.21 +go 1.22.0 require ( dario.cat/mergo v1.0.0