From 98a1b551fec7338e3fdef281d348c25d372ddabd Mon Sep 17 00:00:00 2001 From: Arthur Sengileyev Date: Fri, 2 Dec 2022 12:43:57 +0200 Subject: [PATCH] Build cross-compilation fixes Signed-off-by: Arthur Sengileyev --- .cirrus.yml | 4 ++-- Makefile | 9 ++++++--- docs/remote-docs.sh | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 1b827d9b4e..8ec2ebd9df 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -399,9 +399,9 @@ osx_alt_build_task: - brew install go-md2man - go version build_amd64_script: - - make podman-remote-release-darwin_amd64.zip GOARCH=amd64 + - make podman-remote-release-darwin_amd64.zip build_arm64_script: - - make podman-remote-release-darwin_arm64.zip GOARCH=arm64 + - make podman-remote-release-darwin_arm64.zip build_pkginstaller_script: - cd contrib/pkginstaller - make ARCH=amd64 NO_CODESIGN=1 pkginstaller diff --git a/Makefile b/Makefile index 389b288788..2a23195189 100644 --- a/Makefile +++ b/Makefile @@ -479,7 +479,7 @@ docs: $(MANPAGES) ## Generate documentation # in addition to the target-architecture binary (if different). That's # what the NATIVE_GOOS make does in the first line. podman-remote-%-docs: podman-remote - $(MAKE) podman-remote GOOS=$(NATIVE_GOOS) + $(MAKE) clean-binaries podman-remote GOOS=$(NATIVE_GOOS) GOARCH=$(NATIVE_GOARCH) $(eval GOOS := $*) $(MAKE) docs $(MANPAGES) rm -rf docs/build/remote @@ -707,7 +707,7 @@ podman-remote-release-%.zip: test/version/version ## Build podman-remote for %=$ $(eval GOARCH := $(lastword $(subst _, ,$*))) $(eval _GOPLAT := GOOS=$(call err_if_empty,GOOS) GOARCH=$(call err_if_empty,GOARCH)) mkdir -p "$(call err_if_empty,TMPDIR)/$(SUBDIR)" - $(MAKE) GOOS=$(GOOS) GOARCH=$(NATIVE_GOARCH) \ + $(MAKE) GOOS=$(GOOS) GOARCH=$(GOARCH) \ clean-binaries podman-remote-$(GOOS)-docs if [[ "$(GOARCH)" != "$(NATIVE_GOARCH)" ]]; then \ $(MAKE) CGO_ENABLED=0 $(GOPLAT) BUILDTAGS="$(BUILDTAGS_CROSS)" \ @@ -729,7 +729,10 @@ podman-remote-release-%.zip: test/version/version ## Build podman-remote for %=$ .PHONY: podman.msi podman.msi: test/version/version ## Build podman-remote, package for installation on Windows $(MAKE) podman-v$(call err_if_empty,RELEASE_NUMBER).msi -podman-v%.msi: test/version/version podman-remote podman-remote-windows-docs podman-winpath win-sshproxy +podman-v%.msi: test/version/version +# Passing explicitly OS and ARCH, because ARM is not supported by wixl https://gitlab.gnome.org/GNOME/msitools/-/blob/master/tools/wixl/builder.vala#L3 + $(MAKE) GOOS=windows GOARCH=amd64 podman-remote-windows-docs + $(MAKE) GOOS=windows GOARCH=amd64 clean-binaries podman-remote podman-winpath win-sshproxy $(eval DOCFILE := docs/build/remote/windows) find $(DOCFILE) -print | \ wixl-heat --var var.ManSourceDir --component-group ManFiles \ diff --git a/docs/remote-docs.sh b/docs/remote-docs.sh index f281c19ffa..83ecd66026 100755 --- a/docs/remote-docs.sh +++ b/docs/remote-docs.sh @@ -10,7 +10,8 @@ SOURCES=${@:3} ## directories to find markdown files # invoked in a cross-compilation environment, so even if PLATFORM=windows # we need an actual executable that we can invoke). if [[ -z "$PODMAN" ]]; then - case $(env -i HOME=$HOME PATH=$PATH go env GOOS) in + DETECTED_OS=$(env -i HOME="$HOME" PATH="$PATH" go env GOOS) + case $DETECTED_OS in windows) PODMAN=bin/windows/podman.exe ;; darwin)