[release/v7.4.16] Fix *nix permissions and use certificate_logical_to_actual#27443
Closed
adityapatwardhan wants to merge 8 commits into
Closed
Conversation
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?
Contributor
There was a problem hiding this comment.
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(andcreatedump) and add pipeline checks to validatepwshis executable inside produced.tar.gz. - Add
deb-arm64packaging support and update DEB name validation patterns to allowarm64. - 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.
Member
Author
|
Need to do a manual backport for this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Updates build and packaging scripts to use new ESRP key variables and correct file permissions for release artifacts.
Customer Impact
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.
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.
Changes are limited to packaging scripts and build pipelines. Extensively tested with new regression tests and verified in internal builds.