From eb038725030f6c11d89943e5afd5e8ab3a2abfb2 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Fri, 1 May 2026 13:30:08 -0700 Subject: [PATCH] Add `deb-arm64` package type for Debian arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves the in-repo half of #24076 (DSR for Debian 12 arm64). We already build a `linux-arm64` self-contained binary and a `tar-arm64` tarball, but the only `.deb` we ship is `amd64`. This adds a `deb-arm64` packaging path that consumes the existing arm64 signed binary drop and emits a deb whose control field reports `Architecture: arm64` and whose filename ends in `_arm64.deb`. The packaging logic itself was almost free — `New-DebPackage` already takes `HostArchitecture` and writes it verbatim into the deb control file and output filename, and Debian uses `arm64` natively (no `aarch64` translation like RPM needs). So the new switch arm in `Start-PSPackage` is a clone of `'deb'` with `HostArchitecture = "arm64"`. Pipeline-side: - `linux-package-build.yml` learns the `deb-arm64` packageType and maps it to the `Signed-linux-arm64` drop folder - `PowerShell-Packages-Stages.yml` adds a `deb_arm64` job that consumes the existing `drop_linux_build_linux_arm64` / `drop_linux_sign_linux_arm64` artifacts (the same ones feeding `tar-arm64` today) - `release-validate-packagenames.yml` widens the deb regex from `_amd64\.deb` to `_(amd64|arm64)\.deb` I deliberately did not set `hostArchitecture: arm64` on the new job's pool. Per OneBranch's ARM64 Build Hosts guidance, that flag is for native compilation of arm64 code; we're just running `dpkg-deb` over already-built arm64 binaries, which is what `tar-arm64` does today on the default amd64 linux pool. The existing signing step's `files_to_sign: '**/*.rpm;**/*.deb'` glob already picks up the new artifact with no change. The remaining DSR checklist items (Docker image in PowerShell/PowerShell-Docker, PMC publish, lifecycle and install-doc updates in MicrosoftDocs/PowerShell-Docs) live outside this repo and are tracked on #24076. Drafted by Copilot (Claude Opus 4.7 (High reasoning)). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .pipelines/templates/linux-package-build.yml | 1 + .../release-validate-packagenames.yml | 2 +- .../stages/PowerShell-Packages-Stages.yml | 7 +++++++ .../linux/package-validation.tests.ps1 | 1 + tools/packaging/packaging.psm1 | 20 ++++++++++++++++++- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.pipelines/templates/linux-package-build.yml b/.pipelines/templates/linux-package-build.yml index a832268712c..e37d8555533 100644 --- a/.pipelines/templates/linux-package-build.yml +++ b/.pipelines/templates/linux-package-build.yml @@ -132,6 +132,7 @@ jobs: 'tar' { 'Signed-linux-x64', 'powershell*.tar.gz' } 'tar-alpine-fxdependent' { 'Signed-fxdependent-noopt-linux-musl-x64', 'powershell*.tar.gz' } 'deb' { 'Signed-linux-x64', 'powershell*.deb' } + 'deb-arm64' { 'Signed-linux-arm64', 'powershell*.deb' } 'rpm-fxdependent' { 'Signed-fxdependent-linux-x64', 'powershell*.rpm' } 'rpm-fxdependent-arm64' { 'Signed-fxdependent-linux-arm64', 'powershell*.rpm' } 'rpm' { 'Signed-linux-x64', 'powershell*.rpm' } diff --git a/.pipelines/templates/release-validate-packagenames.yml b/.pipelines/templates/release-validate-packagenames.yml index 7271ffc05a8..5953366ffd7 100644 --- a/.pipelines/templates/release-validate-packagenames.yml +++ b/.pipelines/templates/release-validate-packagenames.yml @@ -109,7 +109,7 @@ jobs: - pwsh: | $message = @() Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.deb | ForEach-Object { - if($_.Name -notmatch 'powershell(-preview|-lts)?_\d+\.\d+\.\d+([\-~][a-z]*.\d+)?-\d\.deb_amd64\.deb') + if($_.Name -notmatch 'powershell(-preview|-lts)?_\d+\.\d+\.\d+([\-~][a-z]*.\d+)?-\d\.deb_(amd64|arm64)\.deb') { $messageInstance = "$($_.Name) is not a valid package name" $message += $messageInstance diff --git a/.pipelines/templates/stages/PowerShell-Packages-Stages.yml b/.pipelines/templates/stages/PowerShell-Packages-Stages.yml index b88a8ec94fc..399d242aa4b 100644 --- a/.pipelines/templates/stages/PowerShell-Packages-Stages.yml +++ b/.pipelines/templates/stages/PowerShell-Packages-Stages.yml @@ -87,6 +87,13 @@ stages: packageType: deb jobName: deb + - template: /.pipelines/templates/linux-package-build.yml@self + parameters: + unsignedDrop: 'drop_linux_build_linux_arm64' + signedDrop: 'drop_linux_sign_linux_arm64' + packageType: deb-arm64 + jobName: deb_arm64 + - template: /.pipelines/templates/linux-package-build.yml@self parameters: unsignedDrop: 'drop_linux_build_linux_fxd_x64_mariner' diff --git a/test/packaging/linux/package-validation.tests.ps1 b/test/packaging/linux/package-validation.tests.ps1 index 594a729fa77..520160f59a6 100644 --- a/test/packaging/linux/package-validation.tests.ps1 +++ b/test/packaging/linux/package-validation.tests.ps1 @@ -61,6 +61,7 @@ Describe "Linux Package Name Validation" { # - powershell-preview_7.6.0-preview.6-1.deb_amd64.deb # - powershell-lts_7.4.13-1.deb_amd64.deb # - powershell_7.4.13-1.deb_amd64.deb + # - powershell_7.6.0-1.deb_arm64.deb # Breakdown: # ^powershell : Starts with 'powershell' # (-preview|-lts)? : Optionally '-preview' or '-lts' diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 4c0c5421ead..2ba77298ae4 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -52,7 +52,7 @@ function Start-PSPackage { [string]$Name = "powershell", # Ubuntu, CentOS, Fedora, macOS, and Windows packages are supported - [ValidateSet("msix", "deb", "osxpkg", "rpm", "rpm-fxdependent", "rpm-fxdependent-arm64", "zip", "zip-pdb", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop", "min-size", "tar-alpine-fxdependent")] + [ValidateSet("msix", "deb", "deb-arm64", "osxpkg", "rpm", "rpm-fxdependent", "rpm-fxdependent-arm64", "zip", "zip-pdb", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop", "min-size", "tar-alpine-fxdependent")] [string[]]$Type, # Generate windows downlevel package @@ -613,6 +613,24 @@ function Start-PSPackage { } } } + 'deb-arm64' { + $Arguments = @{ + Type = 'deb' + PackageSourcePath = $Source + Name = $Name + Version = $Version + Force = $Force + NoSudo = $NoSudo + LTS = $LTS + HostArchitecture = "arm64" + } + foreach ($Distro in $Script:DebianDistributions) { + $Arguments["Distribution"] = $Distro + if ($PSCmdlet.ShouldProcess("Create DEB Package for $Distro (arm64)")) { + New-UnixPackage @Arguments + } + } + } 'rpm' { $Arguments = @{ Type = 'rpm'