From f4ad93d5f64a06b4486d670e1dba746e6fc3f288 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 29 Oct 2024 13:14:07 +0100 Subject: [PATCH 1/3] test/tools/go.mod: remove toolchain Like our main go.mod we never want to force a specific toolchain. Signed-off-by: Paul Holzinger --- test/tools/go.mod | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/tools/go.mod b/test/tools/go.mod index a4cef5676c..c2bce0ec5c 100644 --- a/test/tools/go.mod +++ b/test/tools/go.mod @@ -2,8 +2,6 @@ module github.com/containers/podman/test/tools go 1.22.0 -toolchain go1.22.7 - require ( github.com/cpuguy83/go-md2man/v2 v2.0.5 github.com/go-swagger/go-swagger v0.30.5 From ef20e75a77ebf7edc0d5f09076d17f809c13b99f Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 29 Oct 2024 13:16:19 +0100 Subject: [PATCH 2/3] cirrus: check consitent vendoring in test/tools Ensure nobody modifies files directly there. Signed-off-by: Paul Holzinger --- contrib/cirrus/postbuild.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/cirrus/postbuild.sh b/contrib/cirrus/postbuild.sh index 18150e9dac..0d5ee9c4fd 100755 --- a/contrib/cirrus/postbuild.sh +++ b/contrib/cirrus/postbuild.sh @@ -32,7 +32,8 @@ cd $CIRRUS_WORKING_DIR # Note, make completions and make vendor will already be run in _run_build() # so do not run them again for no reason. This just makes CI slower. -SUGGESTION="run 'make vendor' or 'make completions' and commit all changes" ./hack/tree_status.sh +showrun make -C test/tools vendor +SUGGESTION="run 'make vendor', 'make -C test/tools vendor' and 'make completions' and commit all changes" ./hack/tree_status.sh showrun make .install.goimports showrun make generate-bindings From 0acd192b5936e7161944d1c91f081148758fba10 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 29 Oct 2024 13:21:17 +0100 Subject: [PATCH 3/3] Makefile: vendor target should always remove toolchain We never want the toolchain as the default is to use the same as the go version. So the only purpose of toolchain is to force a newer compiler than necessary which we do not want as we are getting build by many different distributions and block builds that would otherwise work fine is just not helpful to anyone. Also update the go.mod comments remind people that there should be no toolchain. The make vendor target with the toolchain will now guarantee this so the CI will fail otherwise. Signed-off-by: Paul Holzinger --- Makefile | 1 + go.mod | 3 ++- test/tools/Makefile | 1 + test/tools/go.mod | 3 +++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 41582736ce..5a41e77bc2 100644 --- a/Makefile +++ b/Makefile @@ -348,6 +348,7 @@ vendor: $(GO) mod tidy $(GO) mod vendor $(GO) mod verify + $(GO) mod edit -toolchain none # We define *-in-container targets for the following make targets. This allow the targets to be run in a container. diff --git a/go.mod b/go.mod index c8795da1ce..a3b13b34e4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,7 @@ module github.com/containers/podman/v5 -// Warning: Ensure the "go" and "toolchain" versions match exactly to prevent unwanted auto-updates +// Warning: if there is a "toolchain" directive anywhere in this file (and most of the +// time there shouldn't be), its version must be an exact match to the "go" directive. go 1.22.6 diff --git a/test/tools/Makefile b/test/tools/Makefile index 810f5e6145..ea128cf433 100644 --- a/test/tools/Makefile +++ b/test/tools/Makefile @@ -12,6 +12,7 @@ vendor: $(GO) mod tidy $(GO) mod vendor $(GO) mod verify + $(GO) mod edit -toolchain none .PHONY: clean clean: diff --git a/test/tools/go.mod b/test/tools/go.mod index c2bce0ec5c..12460503ac 100644 --- a/test/tools/go.mod +++ b/test/tools/go.mod @@ -1,5 +1,8 @@ module github.com/containers/podman/test/tools +// Warning: if there is a "toolchain" directive anywhere in this file (and most of the +// time there shouldn't be), its version must be an exact match to the "go" directive. + go 1.22.0 require (