Skip to content

[release/v7.6.2] Fix *nix permissions and use certificate_logical_to_actual#27439

Merged
daxian-dbw merged 4 commits into
PowerShell:release/v7.6.2from
daxian-dbw:backport/release/v7.6.2/27385-36673f6d4
May 13, 2026
Merged

[release/v7.6.2] Fix *nix permissions and use certificate_logical_to_actual#27439
daxian-dbw merged 4 commits into
PowerShell:release/v7.6.2from
daxian-dbw:backport/release/v7.6.2/27385-36673f6d4

Conversation

@daxian-dbw
Copy link
Copy Markdown
Member

Backport of #27385 to release/v7.6.2

Triggered by @daxian-dbw 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)

Abstracts signing certificate codes into the certificate_logical_to_actual variable group across mac, linux, nupkg, and windows pipeline templates. Fixes tarball packaging to restore executable permissions on pwsh and createdump before archiving.

Customer Impact

  • Customer reported
  • Found internally

Fixes a two-year-old bug (issue #23968) where the pwsh binary inside Linux/macOS tarballs was not executable. Users downloading the tarball and running ./pwsh would get a permission error.

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Regression test added that inspects the tarball contents before upload and throws if pwsh is not executable (-..x pattern). Covers the fix for issue #23968. Signing cert abstraction validated via the original PR pipeline run.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Adds chmod 755 calls before tarball packaging and a regression test verifying executable bit. Signing cert variables are abstracted via a variable group. No behavioral change to existing packages that already set permissions correctly.

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 13, 2026 22:09
@daxian-dbw daxian-dbw requested review from a team and jshigetomi as code owners May 13, 2026 22:09
@daxian-dbw daxian-dbw added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label May 13, 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

This PR is described as a release backport for *nix tarball permissions and signing certificate abstraction, but the submitted diff only corrects the Linux package template’s signed artifact parameter name.

Changes:

  • Renames the default parameter from signedeDrop to signedDrop.

parameters:
unsignedDrop: 'drop_linux_build_linux_x64'
signedeDrop: 'drop_linux_sign_linux_x64'
signedDrop: 'drop_linux_sign_linux_x64'
andyleejordan and others added 3 commits May 13, 2026 15:21
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 <223556219+Copilot@users.noreply.github.com>
… 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 <223556219+Copilot@users.noreply.github.com>
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 <223556219+Copilot@users.noreply.github.com>
@daxian-dbw
Copy link
Copy Markdown
Member Author

daxian-dbw commented May 13, 2026

Andy's two PRs below were "rebase merged", which is unexpected and caused all commits from those PRs to get into the master branch without squashing. The backport logic assumes squashing merge always, so it only picks up the last commit.

To fix the backporting, I manually cherry-picked all missing commits into this PR, even though the commit ab700d1 actually belongs to #27347.

@daxian-dbw daxian-dbw merged commit b1fbe52 into PowerShell:release/v7.6.2 May 13, 2026
37 checks passed
@daxian-dbw daxian-dbw deleted the backport/release/v7.6.2/27385-36673f6d4 branch May 13, 2026 23:12
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