From d223950078eed4fbf72b5c74f6e920af8b2b4171 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 29 Nov 2022 10:33:59 +0100 Subject: [PATCH 1/3] linux: Build amd64 and arm64 podman-remote-static binaries Looking at https://github.com/containers/podman/releases/tag/v4.3.1, it's not explicit which arch the podman-remote-static binary is built for, so this commit adds an -$(goarch) suffix to it. It builds both arm64 and amd64 binaries as I need both for crc. Signed-off-by: Christophe Fergeau --- Makefile | 9 +++++---- RELEASE_PROCESS.md | 9 ++++++--- contrib/podmanremoteimage/Containerfile | 4 ++-- contrib/podmanremoteimage/README.md | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 389b28878894..b8d259ed78bd 100644 --- a/Makefile +++ b/Makefile @@ -335,10 +335,10 @@ $(SRCBINDIR)/podman$(BINSFX): $(SOURCES) go.mod go.sum | $(SRCBINDIR) -tags "${REMOTETAGS}" \ -o $@ ./cmd/podman -$(SRCBINDIR)/podman-remote-static: $(SRCBINDIR) $(SOURCES) go.mod go.sum +$(SRCBINDIR)/podman-remote-static_amd64 $(SRCBINDIR)/podman-remote-static_arm64: $(SRCBINDIR)/podman-remote-static_%: $(SRCBINDIR) $(SOURCES) go.mod go.sum CGO_ENABLED=0 \ GOOS=linux \ - GOARCH=$(GOARCH) \ + GOARCH=$* \ $(GO) build \ $(BUILDFLAGS) \ $(GO_LDFLAGS) '$(LDFLAGS_PODMAN_STATIC)' \ @@ -362,8 +362,9 @@ $(SRCBINDIR)/quadlet: $(SOURCES) go.mod go.sum .PHONY: quadlet quadlet: bin/quadlet -PHONY: podman-remote-static -podman-remote-static: $(SRCBINDIR)/podman-remote-static +PHONY: podman-remote-static_amd64 podman-remote-static_arm64 +podman-remote-static_amd64: $(SRCBINDIR)/podman-remote-static_amd64 +podman-remote-static_arm64: $(SRCBINDIR)/podman-remote-static_arm64 .PHONY: podman-winpath podman-winpath: $(SOURCES) go.mod go.sum diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index 17590be97174..a90e02e71db9 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -244,10 +244,12 @@ spelled with complete minutiae. $ make podman-remote-release-darwin_amd64.zip \ podman-remote-release-darwin_arm64.zip \ podman-remote-release-windows_amd64.zip \ - podman-remote-static + podman-remote-static_amd64 \ + podman-remote-static_arm64 $ mv podman-* bin/ $ cd bin/ - $ tar -cvzf podman-remote-static.tar.gz podman-remote-static + $ tar -cvzf podman-remote-static_amd64.tar.gz podman-remote-static_amd64 + $ tar -cvzf podman-remote-static_arm64.tar.gz podman-remote-static_arm64 $ sha256sum *.zip *.tar.gz > shasums ``` @@ -270,7 +272,8 @@ spelled with complete minutiae. * podman-remote-release-darwin_arm64.zip * podman-remote-release-windows_amd64.zip * podman-vX.Y.Z.msi - * podman-remote-static.tar.gz + * podman-remote-static_amd64.tar.gz + * podman-remote-static_arm64.tar.gz * shasums 1. Click the Publish button to make the release (or pre-release) available. diff --git a/contrib/podmanremoteimage/Containerfile b/contrib/podmanremoteimage/Containerfile index aa24b3956604..7914b1c26025 100644 --- a/contrib/podmanremoteimage/Containerfile +++ b/contrib/podmanremoteimage/Containerfile @@ -1,10 +1,10 @@ FROM registry.access.redhat.com/ubi8/go-toolset:latest AS builder WORKDIR /opt/app-root/src COPY . . -RUN make podman-remote-static +RUN make podman-remote-static_amd64 RUN GOOS=windows make podman-remote RUN GOOS=darwin make podman-remote FROM scratch COPY --from=builder /opt/app-root/src/bin . -ENTRYPOINT ["/podman-remote-static"] +ENTRYPOINT ["/podman-remote-static_amd64"] diff --git a/contrib/podmanremoteimage/README.md b/contrib/podmanremoteimage/README.md index e43df9c64248..8589b0f1b86a 100644 --- a/contrib/podmanremoteimage/README.md +++ b/contrib/podmanremoteimage/README.md @@ -16,7 +16,7 @@ $ podman cp $(podman create --name remote-temp quay.io/containers/podman-remote- - For Linux binary ```bash -$ podman cp $(podman create --name remote-temp quay.io/containers/podman-remote-artifacts:latest):/podman-remote-static . && podman rm remote-temp +$ podman cp $(podman create --name remote-temp quay.io/containers/podman-remote-artifacts:latest):/podman-remote-static_amd64 . && podman rm remote-temp ``` - For Mac binary From fe548dd0b053389829bbd385c64cd580fb378ae4 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 29 Nov 2022 10:44:22 +0100 Subject: [PATCH 2/3] linux: Add -linux suffix to podman-remote-static binaries This is more consistent with the name of the other released files, and makes identification of the binaries easier among the Windows/macOS ones. Related: https://github.com/containers/podman/issues/16612 Signed-off-by: Christophe Fergeau --- Makefile | 8 ++++---- RELEASE_PROCESS.md | 12 ++++++------ contrib/podmanremoteimage/Containerfile | 4 ++-- contrib/podmanremoteimage/README.md | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index b8d259ed78bd..e9daf0604cfb 100644 --- a/Makefile +++ b/Makefile @@ -335,7 +335,7 @@ $(SRCBINDIR)/podman$(BINSFX): $(SOURCES) go.mod go.sum | $(SRCBINDIR) -tags "${REMOTETAGS}" \ -o $@ ./cmd/podman -$(SRCBINDIR)/podman-remote-static_amd64 $(SRCBINDIR)/podman-remote-static_arm64: $(SRCBINDIR)/podman-remote-static_%: $(SRCBINDIR) $(SOURCES) go.mod go.sum +$(SRCBINDIR)/podman-remote-static-linux_amd64 $(SRCBINDIR)/podman-remote-static-linux_arm64: $(SRCBINDIR)/podman-remote-static-linux_%: $(SRCBINDIR) $(SOURCES) go.mod go.sum CGO_ENABLED=0 \ GOOS=linux \ GOARCH=$* \ @@ -362,9 +362,9 @@ $(SRCBINDIR)/quadlet: $(SOURCES) go.mod go.sum .PHONY: quadlet quadlet: bin/quadlet -PHONY: podman-remote-static_amd64 podman-remote-static_arm64 -podman-remote-static_amd64: $(SRCBINDIR)/podman-remote-static_amd64 -podman-remote-static_arm64: $(SRCBINDIR)/podman-remote-static_arm64 +PHONY: podman-remote-static-linux_amd64 podman-remote-static-linux_arm64 +podman-remote-static-linux_amd64: $(SRCBINDIR)/podman-remote-static-linux_amd64 +podman-remote-static-linux_arm64: $(SRCBINDIR)/podman-remote-static-linux_arm64 .PHONY: podman-winpath podman-winpath: $(SOURCES) go.mod go.sum diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index a90e02e71db9..9037b87f5da8 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -244,12 +244,12 @@ spelled with complete minutiae. $ make podman-remote-release-darwin_amd64.zip \ podman-remote-release-darwin_arm64.zip \ podman-remote-release-windows_amd64.zip \ - podman-remote-static_amd64 \ - podman-remote-static_arm64 + podman-remote-static-linux_amd64 \ + podman-remote-static-linux_arm64 $ mv podman-* bin/ $ cd bin/ - $ tar -cvzf podman-remote-static_amd64.tar.gz podman-remote-static_amd64 - $ tar -cvzf podman-remote-static_arm64.tar.gz podman-remote-static_arm64 + $ tar -cvzf podman-remote-static-linux_amd64.tar.gz podman-remote-static-linux_amd64 + $ tar -cvzf podman-remote-static-linux_arm64.tar.gz podman-remote-static-linux_arm64 $ sha256sum *.zip *.tar.gz > shasums ``` @@ -272,8 +272,8 @@ spelled with complete minutiae. * podman-remote-release-darwin_arm64.zip * podman-remote-release-windows_amd64.zip * podman-vX.Y.Z.msi - * podman-remote-static_amd64.tar.gz - * podman-remote-static_arm64.tar.gz + * podman-remote-static-linux_amd64.tar.gz + * podman-remote-static-linux_arm64.tar.gz * shasums 1. Click the Publish button to make the release (or pre-release) available. diff --git a/contrib/podmanremoteimage/Containerfile b/contrib/podmanremoteimage/Containerfile index 7914b1c26025..7d19bf6b0844 100644 --- a/contrib/podmanremoteimage/Containerfile +++ b/contrib/podmanremoteimage/Containerfile @@ -1,10 +1,10 @@ FROM registry.access.redhat.com/ubi8/go-toolset:latest AS builder WORKDIR /opt/app-root/src COPY . . -RUN make podman-remote-static_amd64 +RUN make podman-remote-static-linux_amd64 RUN GOOS=windows make podman-remote RUN GOOS=darwin make podman-remote FROM scratch COPY --from=builder /opt/app-root/src/bin . -ENTRYPOINT ["/podman-remote-static_amd64"] +ENTRYPOINT ["/podman-remote-static-linux_amd64"] diff --git a/contrib/podmanremoteimage/README.md b/contrib/podmanremoteimage/README.md index 8589b0f1b86a..ea4be3a8658b 100644 --- a/contrib/podmanremoteimage/README.md +++ b/contrib/podmanremoteimage/README.md @@ -16,7 +16,7 @@ $ podman cp $(podman create --name remote-temp quay.io/containers/podman-remote- - For Linux binary ```bash -$ podman cp $(podman create --name remote-temp quay.io/containers/podman-remote-artifacts:latest):/podman-remote-static_amd64 . && podman rm remote-temp +$ podman cp $(podman create --name remote-temp quay.io/containers/podman-remote-artifacts:latest):/podman-remote-static-linux_amd64 . && podman rm remote-temp ``` - For Mac binary From 54ef7f98d9bca71482bc6a7050e42c6fb2a0857b Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 29 Nov 2022 10:53:52 +0100 Subject: [PATCH 3/3] macos: pkg: Use -arm64 suffix instead of -aarch64 All files released in https://github.com/containers/podman/releases/tag/v4.3.1 use -arm64 for the arch name except podman-installer-macos-aarch64.pkg Related: https://github.com/containers/podman/issues/16612 Signed-off-by: Christophe Fergeau --- contrib/pkginstaller/Makefile | 7 ++++++- contrib/pkginstaller/package.sh | 13 +++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/contrib/pkginstaller/Makefile b/contrib/pkginstaller/Makefile index 4e76482a64eb..f88d5e7a4f2b 100644 --- a/contrib/pkginstaller/Makefile +++ b/contrib/pkginstaller/Makefile @@ -1,6 +1,11 @@ SHELL := bash ARCH ?= aarch64 +ifeq ($(ARCH), aarch64) + GOARCH:=arm64 +else + GOARCH:=$(ARCH) +endif GVPROXY_VERSION ?= 0.4.0 QEMU_VERSION ?= 7.1.0-1 GVPROXY_RELEASE_URL ?= https://github.com/containers/gvisor-tap-vsock/releases/download/v$(GVPROXY_VERSION)/gvproxy-darwin @@ -8,7 +13,7 @@ QEMU_RELEASE_URL ?= https://github.com/containers/podman-machine-qemu/releases/d PACKAGE_DIR ?= out/packaging TMP_DOWNLOAD ?= tmp-download PACKAGE_ROOT ?= root -PKG_NAME := podman-installer-macos-$(ARCH).pkg +PKG_NAME := podman-installer-macos-$(GOARCH).pkg default: pkginstaller diff --git a/contrib/pkginstaller/package.sh b/contrib/pkginstaller/package.sh index f6f7cef16864..48d3a85a18b7 100755 --- a/contrib/pkginstaller/package.sh +++ b/contrib/pkginstaller/package.sh @@ -17,10 +17,6 @@ arch=$(cat "${BASEDIR}/ARCH") function build_podman() { pushd "$1" - local goArch="${arch}" - if [ "${goArch}" = aarch64 ]; then - goArch=arm64 - fi make GOARCH="${goArch}" podman-remote HELPER_BINARIES_DIR="${HELPER_BINARIES_DIR}" make GOARCH="${goArch}" podman-mac-helper cp bin/darwin/podman "contrib/pkginstaller/out/packaging/${binDir}/podman" @@ -66,6 +62,11 @@ function signQemu() { --entitlements "${BASEDIR}/hvf.entitlements" "${qemuBinDir}/qemu-system-${qemuArch}" } +goArch="${arch}" +if [ "${goArch}" = aarch64 ]; then + goArch=arm64 +fi + build_podman "../../../../" sign "${binDir}/podman" sign "${binDir}/gvproxy" @@ -86,7 +87,7 @@ productbuild --distribution "${BASEDIR}/Distribution" \ rm "${OUTPUT}/podman.pkg" if [ ! "${NO_CODESIGN}" -eq "1" ]; then - productsign --timestamp --sign "${PRODUCTSIGN_IDENTITY}" "${OUTPUT}/podman-unsigned.pkg" "${OUTPUT}/podman-installer-macos-${arch}.pkg" + productsign --timestamp --sign "${PRODUCTSIGN_IDENTITY}" "${OUTPUT}/podman-unsigned.pkg" "${OUTPUT}/podman-installer-macos-${goArch}.pkg" else - mv "${OUTPUT}/podman-unsigned.pkg" "${OUTPUT}/podman-installer-macos-${arch}.pkg" + mv "${OUTPUT}/podman-unsigned.pkg" "${OUTPUT}/podman-installer-macos-${goArch}.pkg" fi