From bb85aae4a43a0106448287e4b938fa2d896c59a5 Mon Sep 17 00:00:00 2001 From: apostasie Date: Mon, 5 May 2025 12:33:23 -0700 Subject: [PATCH 1/4] Add darwin to Makefile Signed-off-by: apostasie --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d7dce5f0fd3..85af13483b7 100644 --- a/Makefile +++ b/Makefile @@ -136,7 +136,8 @@ lint-go-all: @cd $(MAKEFILE_DIR) \ && GOOS=linux make lint-go \ && GOOS=windows make lint-go \ - && GOOS=freebsd make lint-go + && GOOS=freebsd make lint-go \ + && GOOS=darwin make lint-go $(call footer, $@) lint-yaml: @@ -179,8 +180,9 @@ lint-licenses-all: $(call title, $@) @cd $(MAKEFILE_DIR) \ && GOOS=linux make lint-licenses \ + && GOOS=windows make lint-licenses \ && GOOS=freebsd make lint-licenses \ - && GOOS=windows make lint-licenses + && GOOS=darwin make lint-go $(call footer, $@) ########################## @@ -196,8 +198,9 @@ fix-go-all: $(call title, $@) @cd $(MAKEFILE_DIR) \ && GOOS=linux make fix-go \ + && GOOS=windows make fix-go \ && GOOS=freebsd make fix-go \ - && GOOS=windows make fix-go + && GOOS=darwin make lint-go $(call footer, $@) fix-mod: From e64dc6b4942187ecadf93d34037a79b3df3aecf8 Mon Sep 17 00:00:00 2001 From: apostasie Date: Mon, 5 May 2025 12:38:14 -0700 Subject: [PATCH 2/4] More defensive makefile Signed-off-by: apostasie --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 85af13483b7..3544c484612 100644 --- a/Makefile +++ b/Makefile @@ -39,9 +39,9 @@ DOCDIR ?= $(DATADIR)/doc BINARY ?= "nerdctl" MAKEFILE_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))) -VERSION ?= $(shell git -C $(MAKEFILE_DIR) describe --match 'v[0-9]*' --dirty='.m' --always --tags) +VERSION ?= $(shell git -C $(MAKEFILE_DIR) describe --match 'v[0-9]*' --dirty='.m' --always --tags 2>/dev/null || echo no_git_information) VERSION_TRIMMED := $(VERSION:v%=%) -REVISION ?= $(shell git -C $(MAKEFILE_DIR) rev-parse HEAD)$(shell if ! git -C $(MAKEFILE_DIR) diff --no-ext-diff --quiet --exit-code; then echo .m; fi) +REVISION ?= $(shell git -C $(MAKEFILE_DIR) rev-parse HEAD 2>/dev/null || echo no_git_information)$(shell if ! git -C $(MAKEFILE_DIR) diff --no-ext-diff --quiet --exit-code 2>/dev/null; then echo .m; fi) LINT_COMMIT_RANGE ?= main..HEAD GO_BUILD_LDFLAGS ?= -s -w GO_BUILD_FLAGS ?= From 2e81f212706ad70fc40c2ca371ae9ba83b432be3 Mon Sep 17 00:00:00 2001 From: apostasie Date: Sun, 4 May 2025 18:02:04 -0700 Subject: [PATCH 3/4] Integration in-container: simplify job Signed-off-by: apostasie --- .github/workflows/job-test-in-container.yml | 15 +++++---------- Dockerfile.d/test-integration-rootless.sh | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/job-test-in-container.yml b/.github/workflows/job-test-in-container.yml index 354d3bb36cd..ddc8bb7fe44 100644 --- a/.github/workflows/job-test-in-container.yml +++ b/.github/workflows/job-test-in-container.yml @@ -56,6 +56,11 @@ jobs: run: shell: bash + env: + # https://github.com/containerd/nerdctl/issues/622 + # The only case when rootlesskit-version is force-specified is when we downgrade explicitly to v1 + WORKAROUND_ISSUE_622: ${{ inputs.rootlesskit-version }} + steps: - name: "Init: checkout" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -137,16 +142,6 @@ jobs: sudo mkdir -p /etc/docker echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json sudo systemctl restart docker - # Rootless with old rootlesskit wants to disable buildkit - - if: ${{ inputs.target != 'rootful' && inputs.rootlesskit-version != '' }} - name: "Init: disable buildkit for old rootlesskit" - run: | - # https://github.com/containerd/nerdctl/issues/622 - WORKAROUND_ISSUE_622= - if echo "${ROOTLESSKIT_VERSION}" | grep -q v1; then - WORKAROUND_ISSUE_622=1 - fi - echo "WORKAROUND_ISSUE_622=$WORKAROUND_ISSUE_622" >> "$GITHUB_ENV" - name: "Run: integration tests" run: | . ./hack/github/action-helpers.sh diff --git a/Dockerfile.d/test-integration-rootless.sh b/Dockerfile.d/test-integration-rootless.sh index 481610eb1bc..f6e243f32b5 100755 --- a/Dockerfile.d/test-integration-rootless.sh +++ b/Dockerfile.d/test-integration-rootless.sh @@ -26,7 +26,7 @@ if [[ "$(id -u)" = "0" ]]; then fi : "${WORKAROUND_ISSUE_622:=}" - if [[ "$WORKAROUND_ISSUE_622" = "1" ]]; then + if [[ "$WORKAROUND_ISSUE_622" != "" ]]; then touch /workaround-issue-622 fi From e65860255e63bbcef9a356f05b1f6da1f7c942ac Mon Sep 17 00:00:00 2001 From: apostasie Date: Tue, 6 May 2025 10:49:59 -0700 Subject: [PATCH 4/4] Increase timeout for windows on TestRunRmTime Signed-off-by: apostasie --- cmd/nerdctl/container/container_run_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/nerdctl/container/container_run_test.go b/cmd/nerdctl/container/container_run_test.go index 23b74b97714..568fe851107 100644 --- a/cmd/nerdctl/container/container_run_test.go +++ b/cmd/nerdctl/container/container_run_test.go @@ -600,7 +600,11 @@ func TestRunRmTime(t *testing.T) { base.Cmd("run", "--rm", testutil.CommonImage, "true").AssertOK() t1 := time.Now() took := t1.Sub(t0) - const deadline = 3 * time.Second + var deadline = 3 * time.Second + // FIXME: Investigate? it appears that since the move to containerd 2 on Windows, this is taking longer. + if runtime.GOOS == "windows" { + deadline = 10 * time.Second + } if took > deadline { t.Fatalf("expected to have completed in %v, took %v", deadline, took) }