Skip to content

Commit

Permalink
Merge pull request #16708 from arixmkii/cross-build-fixes
Browse files Browse the repository at this point in the history
Build cross-compilation fixes
  • Loading branch information
openshift-merge-robot committed Dec 2, 2022
2 parents b0bd257 + 98a1b55 commit 480c7fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Expand Up @@ -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
Expand Down Expand Up @@ -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)" \
Expand All @@ -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 \
Expand Down
3 changes: 2 additions & 1 deletion docs/remote-docs.sh
Expand Up @@ -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)
Expand Down

0 comments on commit 480c7fb

Please sign in to comment.