Build cross-compilation fixes

Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
This commit is contained in:
Arthur Sengileyev
2022-12-02 12:43:57 +02:00
parent 51deb324a3
commit 98a1b551fe
3 changed files with 10 additions and 6 deletions

View File

@ -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

View File

@ -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 \

View File

@ -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)