Skip to content

[release/v7.4.16] Fix *nix permissions and use certificate_logical_to_actual#27443

Closed
adityapatwardhan wants to merge 8 commits into
PowerShell:release/v7.4.16from
adityapatwardhan:backport/release/v7.4.16/27385-da95729be
Closed

[release/v7.4.16] Fix *nix permissions and use certificate_logical_to_actual#27443
adityapatwardhan wants to merge 8 commits into
PowerShell:release/v7.4.16from
adityapatwardhan:backport/release/v7.4.16/27385-da95729be

Conversation

@adityapatwardhan
Copy link
Copy Markdown
Member

Backport of #27385 to release/v7.4.16

Triggered by @adityapatwardhan on behalf of @andyleejordan

Original CL Label: CL-BuildPackaging

/cc @PowerShell/powershell-maintainers

Impact

REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

Updates build and packaging scripts to use new ESRP key variables and correct file permissions for release artifacts.

Customer Impact

  • Customer reported
  • Found internally

Restores executable permissions for pwsh in tarballs, adds regression tests, and finalizes ESRP key abstraction. Addresses #23968 and internal build issues.

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Validated by running full build and packaging pipelines for Linux and macOS. Regression tests added for tarball permissions. All artifacts verified for correct signing and permissions.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Changes are limited to packaging scripts and build pipelines. Extensively tested with new regression tests and verified in internal builds.

andyleejordan and others added 6 commits May 13, 2026 17:47
We still need to apply the template signing so that Guardian tasks pass
and so that script files are signed. After doing what's essentially
Windows signing, we sign and harden the binaries for macOS. Then we do
the same for the PKG installer, and finally notarize it. The ESRP
signing service requires a zip of files for Apple signing at all stages.
Now that we can use it via the OneBranch signing task we no longer need
the service connection or variable group that was trying to set it up.
Notarization requires the BundleId from Get-MacOSPackageIdentifierInfo.

Co-authored-by: Copilot <[email protected]>
Uses codesign in the macOS build step to apply entitlements from a plist.
This is required for the hardened runtime (which is required for notarization).

See: https://learn.microsoft.com/en-us/dotnet/core/install/macos-notarization-issues#default-entitlements

Co-authored-by: Copilot <[email protected]>
The tarball staging path used `Copy-Item`, which on *nix doesn't preserve
the source file mode, so `pwsh` ended up 644 in the `.tar.gz`. The Debian,
RPM, and macOS PKG paths explicitly `chmod` everything to 644 and then bump
`pwsh` back to 755, which silently demoted `createdump` (the .NET helper
that produces crash minidumps) along with it. Now we `chmod 755` both
executables in all package staging paths, guarded by `Test-Path` since
fxdependent builds don't bundle `createdump`.

Also added regression tests which check the permissions of `pwsh` inside
the Linux and macOS tarballs before we upload them.

Co-authored-by: Copilot <[email protected]>
… group

The `CP-…` key codes used for ESRP signing are now set from ADO via the
`certificate_logical_to_actual` variable group. The templates reference
the following variables instead of literal codes:

- `$(authenticode_cert_id)`
- `$(authenticode_test_cert_id)`
- `$(nuget_cert_id)`
- `$(apple_cert_id)`
- `$(pgp_linux_cert_id)`
- `$(pgp_release_cert_id)`

`nupkg.yml`, `mac-package-build.yml`, and `linux-package-build.yml` pick
up the new group import. `linux-package-build.yml` also now selects the
PGP signing profile based on whether `jobName` starts with `mariner`, so
`PowerShell-Packages-Stages.yml` no longer threads a `signingProfile`
parameter in for the two Mariner jobs.

Co-authored-by: Copilot <[email protected]>
It's been this way for a couple years which means we've been passing...something else?
Copilot AI review requested due to automatic review settings May 14, 2026 00:48
@adityapatwardhan adityapatwardhan requested a review from a team as a code owner May 14, 2026 00:48
@adityapatwardhan adityapatwardhan added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label May 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Backport to release/v7.4.16 that fixes missing executable permissions in *nix tarball artifacts (notably pwsh) and updates OneBranch pipeline signing configuration to use the certificate_logical_to_actual variable group rather than hardcoded cert/profile IDs.

Changes:

  • Restore executable permissions during packaging (tarball + Unix packages) for pwsh (and createdump) and add pipeline checks to validate pwsh is executable inside produced .tar.gz.
  • Add deb-arm64 packaging support and update DEB name validation patterns to allow arm64.
  • Replace hardcoded ESRP/OneBranch cert identifiers with variables sourced from certificate_logical_to_actual.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/packaging/packaging.psm1 Adds deb-arm64 handling and ensures pwsh/createdump are chmod’d executable for tarballs and DEB staging.
tools/packaging/packaging.psd1 Exports Get-MacOSPackageIdentifierInfo for pipeline use.
test/packaging/linux/package-validation.tests.ps1 Extends DEB filename validation docs/examples to include arm64.
assets/macos-entitlements.plist Adds entitlements file used during macOS build signing preparation.
.pipelines/templates/windows-hosted-build.yml Switches NuPkg signing cp_code to $(nuget_cert_id).
.pipelines/templates/stages/PowerShell-Packages-Stages.yml Adds a deb-arm64 packaging job and removes explicit Mariner signing profile parameters.
.pipelines/templates/shouldSign.yml Uses cert ID variables ($(authenticode_cert_id), etc.) instead of hardcoded CP codes.
.pipelines/templates/release-validate-packagenames.yml Updates DEB name validation regex to accept arm64 as well as amd64.
.pipelines/templates/nupkg.yml Adds certificate_logical_to_actual group and switches NuPkg signing to $(nuget_cert_id).
.pipelines/templates/mac.yml Applies entitlements to pwsh and adds Apple signing of Mach-O outputs using $(apple_cert_id).
.pipelines/templates/mac-package-build.yml Verifies codesign, validates tarball pwsh permissions, computes BundleId, and updates signing/notarization to use $(apple_cert_id).
.pipelines/templates/linux-package-build.yml Fixes signedDrop parameter name, selects PGP signing profile via cert-id variables, adds deb-arm64, and validates tarball pwsh permissions.

Comment on lines +56 to +59

=======
[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")]
>>>>>>> ddff03a50 (Create PowerShell package for arm debian distribution (#26925))
Removed parameters for deb-arm64 package build.
Removed the 'deb-arm64' package configuration from the build pipeline.
@adityapatwardhan
Copy link
Copy Markdown
Member Author

Need to do a manual backport for this one.

@adityapatwardhan adityapatwardhan deleted the backport/release/v7.4.16/27385-da95729be branch May 14, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants