From 04ee90dab35649bf17162978d27c7d06265eb3b8 Mon Sep 17 00:00:00 2001 From: Mario Loriedo Date: Wed, 7 May 2025 14:55:48 +0200 Subject: [PATCH] Fix windows arm64 installer build This is a followup of https://github.com/containers/podman/pull/26048 It fixes `process-release.ps1` that was always looking for the amd64 release zip file, even if `$env:PODMAN_ARCH` was set to arm64. With this fix it looks for the right zip file. It fixes `winmake.ps1` that, when the `-arch` param was not passed, set `$env:PODMAN_ARCH` to the empty string instead of the local `$env:GOARCH`. Signed-off-by: Mario Loriedo --- contrib/win-installer/build.ps1 | 2 +- contrib/win-installer/process-release.ps1 | 8 ++++++-- winmake.ps1 | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/contrib/win-installer/build.ps1 b/contrib/win-installer/build.ps1 index 1c91cff889..42ba85fcde 100644 --- a/contrib/win-installer/build.ps1 +++ b/contrib/win-installer/build.ps1 @@ -105,7 +105,7 @@ if ($ENV:INSTVER -eq "") { } $installerPlatform = "" -if ($null -eq $ENV:PODMAN_ARCH -or $ENV:PODMAN_ARCH -eq "amd64") { +if ($null -eq $ENV:PODMAN_ARCH -or "" -eq $ENV:PODMAN_ARCH -or "amd64" -eq $ENV:PODMAN_ARCH) { $installerPlatform = "x64" } elseif ($ENV:PODMAN_ARCH -eq "arm64") { $installerPlatform = "arm64" diff --git a/contrib/win-installer/process-release.ps1 b/contrib/win-installer/process-release.ps1 index 5392831632..aebaaa2dcd 100644 --- a/contrib/win-installer/process-release.ps1 +++ b/contrib/win-installer/process-release.ps1 @@ -97,10 +97,14 @@ try { $restore = 1 $ProgressPreference = 'SilentlyContinue'; + if ($null -eq $ENV:PODMAN_ARCH -or "" -eq $ENV:PODMAN_ARCH ) { + Write-Warning "PODMAN_ARCH not set, defaulting to amd64" + $ENV:PODMAN_ARCH = "amd64" + } if ($releaseDir.Length -gt 0) { - Copy-Item -Path "$releaseDir/podman-remote-release-windows_amd64.zip" "release.zip" + Copy-Item -Path "$releaseDir/podman-remote-release-windows_${ENV:PODMAN_ARCH}.zip" "release.zip" } else { - DownloadOrSkip "$base_url/releases/download/$version/podman-remote-release-windows_amd64.zip" "release.zip" + DownloadOrSkip "$base_url/releases/download/$version/podman-remote-release-windows_${ENV:PODMAN_ARCH}.zip" "release.zip" DownloadOptional "$base_url/releases/download/$version/shasums" ..\shasums } Expand-Archive -Path release.zip diff --git a/winmake.ps1 b/winmake.ps1 index d9188abdd9..f948a31e7f 100644 --- a/winmake.ps1 +++ b/winmake.ps1 @@ -14,6 +14,7 @@ param ( Write-Warning "Unsupported architecture $arch. Using default ($defaultArchitecture)." return $defaultArchitecture } + return $arch ), [parameter(ValueFromRemainingArguments)][object[]]$params = @() ) @@ -108,7 +109,7 @@ function Installer{ [string]$version, [string]$suffix = "dev" ); - Write-Host "Building the windows installer" + Write-Host "Building the windows installer for $architecture" # Check for the files to include in the installer $requiredArtifacts = @(