Skip to content

[release/v7.4.16] Fix executable permissions for pwsh and createdump; Move ESRP key codes into the certificate_logical_to_actual variable group#27442

Closed
adityapatwardhan wants to merge 2 commits into
PowerShell:release/v7.4.16from
adityapatwardhan:backport/release/v7.4.16/27354-5a0f76760
Closed

[release/v7.4.16] Fix executable permissions for pwsh and createdump; Move ESRP key codes into the certificate_logical_to_actual variable group#27442
adityapatwardhan wants to merge 2 commits into
PowerShell:release/v7.4.16from
adityapatwardhan:backport/release/v7.4.16/27354-5a0f76760

Conversation

@adityapatwardhan
Copy link
Copy Markdown
Member

Backport of #27354 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

Fixes build and signing pipeline issues for macOS and Linux packages, ensuring correct ESRP key usage and executable permissions. Addresses internal build failures and improves release reliability.

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

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

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Changes are limited to build and packaging scripts, with no impact on product runtime. Verified by internal build/test pipelines.

andyleejordan and others added 2 commits May 13, 2026 16:40
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]>
Copilot AI review requested due to automatic review settings May 14, 2026 00:44
@adityapatwardhan adityapatwardhan requested a review from a team as a code owner May 14, 2026 00:44
@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 of #27354 to release/v7.4.16. Restores executable permissions on pwsh/createdump in the tarball, deb, and rpm packaging paths (with regression tests in the macOS/Linux build pipelines), and migrates hard-coded ESRP CP-* cert codes to variables sourced from the certificate_logical_to_actual variable group.

Changes:

  • Add chmod 755 for pwsh and createdump in the tarball staging, deb postbuild, and rpm packaging code paths.
  • Replace hard-coded ESRP CP-* codes with $(nuget_cert_id), $(authenticode_cert_id), $(authenticode_test_cert_id), $(apple_cert_id), and $(pgp_*_cert_id) variables; include the certificate_logical_to_actual group where needed.
  • Add tarball verification (tar -tzvf … pwsh) in linux-package-build.yml and mac-package-build.yml, plus an Apple Mach-O signing step in mac.yml.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/packaging/packaging.psm1 Ensure pwsh/createdump are executable for tarball, deb, and rpm packages
.pipelines/templates/windows-hosted-build.yml Use $(nuget_cert_id) instead of hard-coded CP-401405
.pipelines/templates/stages/PowerShell-Packages-Stages.yml Drop obsolete signingProfile parameters for Mariner builds
.pipelines/templates/shouldSign.yml Use authenticode cert id variables instead of CP-230012/CP-460906
.pipelines/templates/nupkg.yml Add cert variable group and use $(nuget_cert_id) for nupkg signing
.pipelines/templates/mac.yml Add Apple Mach-O signing step — contains unresolved merge conflict
.pipelines/templates/mac-package-build.yml Use $(apple_cert_id) and verify tarball perms — contains unresolved merge conflict
.pipelines/templates/linux-package-build.yml Select PGP signing profile by job name; verify pwsh executable in tar.gz

Comment on lines +179 to +189
}
}
]

- pwsh: |
$signedDir = "$(ob_outputDirectory)/Signed-$(Runtime)"
$zipFile = "$(Pipeline.Workspace)/macho-$(BuildArchitecture).zip"
Expand-Archive -Path $zipFile -DestinationPath $signedDir -Force -Verbose
displayName: Expand Apple-signed Mach-O binaries into signed output

>>>>>>> 6bffb1bb5 (Move ESRP key codes into the `certificate_logical_to_actual` variable group)
Comment on lines 222 to +258
@@ -227,6 +235,27 @@ jobs:
}
]

- task: onebranch.pipeline.signing@1
displayName: 'OneBranch Notarize Package'
inputs:
command: 'sign'
files_to_sign: '**/*-osx-*.zip'
search_root: '$(Pipeline.Workspace)'
inline_operation: |
[
{
"KeyCode": "$(apple_cert_id)",
"OperationCode": "MacAppNotarize",
"ToolName": "sign",
"ToolVersion": "1.0",
"Parameters": {
"BundleId": "$(BundleId)"
}
}
]
timeoutInMinutes: 120

>>>>>>> 6bffb1bb5 (Move ESRP key codes into the `certificate_logical_to_actual` variable group)
@adityapatwardhan
Copy link
Copy Markdown
Member Author

this should be backported.

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.

3 participants