From 80d7cb87f14cdc488857adf6011ae98f97a5e501 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 9 Sep 2021 14:11:50 -0400 Subject: [PATCH 1/2] Makefile: update cross targets Update the "cross" makefile target to just try building on every Linux, Darwin, or Windows architecture that the current version of Go supports. That way, the next time we upgrade Go to a version that supports more architectures, we won't have to remember to update the list of cross-compile targets that we try to build in CI to catch cross-compilation problems. Marking this as not needing new tests because it directly modifies one of our CI tests. [NO NEW TESTS NEEDED] Signed-off-by: Nalin Dahyabhai --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3214601b78..27e4ade6d6 100644 --- a/Makefile +++ b/Makefile @@ -70,8 +70,11 @@ bin/buildah: $(SOURCES) cmd/buildah/*.go .PHONY: buildah buildah: bin/buildah +LINUX_CROSS_TARGETS = $(addprefix bin/buildah.,$(subst /,.,$(shell $(GO) tool dist list | grep ^linux/))) +DARWIN_CROSS_TARGETS = $(addprefix bin/buildah.,$(subst /,.,$(shell $(GO) tool dist list | grep ^darwin/))) +WINDOWS_CROSS_TARGETS = $(addsuffix .exe,$(addprefix bin/buildah.,$(subst /,.,$(shell $(GO) tool dist list | grep ^windows/)))) .PHONY: cross -cross: bin/buildah.darwin.amd64 bin/buildah.linux.386 bin/buildah.linux.amd64 bin/buildah.linux.arm64 bin/buildah.linux.arm bin/buildah.linux.mips64 bin/buildah.linux.mips64le bin/buildah.linux.mips bin/buildah.linux.mipsle bin/buildah.linux.ppc64 bin/buildah.linux.ppc64le bin/buildah.linux.riscv64 bin/buildah.linux.s390x bin/buildah.windows.amd64.exe +cross: $(LINUX_CROSS_TARGETS) $(DARWIN_CROSS_TARGETS) $(WINDOWS_CROSS_TARGETS) bin/buildah.%: mkdir -p ./bin From 9560ff5b42645aa25b7fe0599e9c1f37138ec173 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 9 Sep 2021 14:11:50 -0400 Subject: [PATCH 2/2] .cirrus.yml: run cross_build_task on Big Sur Update which version of Mac OS X we use for running the cross-compile check in CI from Catalina (10.15) to Big Sur (11). Signed-off-by: Nalin Dahyabhai --- .cirrus.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index d7c90bfd15..c9629b9a34 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -177,7 +177,7 @@ conformance_task: conformance_test_script: '${SCRIPT_BASE}/test.sh conformance |& ${_TIMESTAMP}' -# Confirm cross-compile ALL archetectures on a Mac OS-X VM. +# Confirm cross-compile ALL architectures on a Mac OS-X VM. cross_build_task: name: "Cross Compile" alias: cross_build @@ -186,13 +186,14 @@ cross_build_task: - unit osx_instance: - image: 'catalina-base' + image: 'big-sur-base' script: - brew update - brew install go - brew install go-md2man - brew install gpgme + - go version - make cross CGO_ENABLED=0 binary_artifacts: