| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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 <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
This PR (backport of #27347) starts introducing macOS hardened runtime preparation by adding an entitlements plist and applying those entitlements to the built pwsh binary in the macOS build pipeline via codesign.
Changes:
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| assets/macos-entitlements.plist | Introduces an entitlements plist to be applied during macOS signing/hardening. |
| .pipelines/templates/mac.yml | Applies the entitlements to pwsh during the macOS build job via codesign. |
Sorry, something went wrong.
| $entitlements = "$(PowerShellRoot)/assets/macos-entitlements.plist" | ||
| $pwshBin = "$(OB_OUTPUTDIRECTORY)/pwsh" | ||
| Write-Verbose -Verbose "Applying entitlements to $pwshBin" | ||
| codesign --sign - --force --options runtime --entitlements $entitlements $pwshBin | ||
| if ($LASTEXITCODE -ne 0) { |
| $entitlements = "$(PowerShellRoot)/assets/macos-entitlements.plist" | ||
| $pwshBin = "$(OB_OUTPUTDIRECTORY)/pwsh" | ||
| Write-Verbose -Verbose "Applying entitlements to $pwshBin" | ||
| codesign --sign - --force --options runtime --entitlements $entitlements $pwshBin | ||
| if ($LASTEXITCODE -ne 0) { | ||
| throw "codesign failed with exit code $LASTEXITCODE" | ||
| } | ||
|
|
| <true/> | ||
| <key>com.apple.security.cs.allow-dyld-environment-variables</key> | ||
| <true/> | ||
| <key>com.apple.security.cs.disable-library-validation</key> | ||
| <true/> |
|
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.
Therefore, a commit was missed for this backport PR. I manually backported the missing commits into #27439, even though it doesn't really belong there. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Backport of #27347 to release/v7.6.2
Triggered by Dongbo Wang (@daxian-dbw) on behalf of Andy Jordan (@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
Adds Apple notarization for macOS packages: signs and hardens binaries using ESRP/OneBranch signing tasks, notarizes the PKG installer, and applies entitlements required for the hardened runtime.
Customer Impact
Regression
REQUIRED: Check exactly one box.
This is not a regression.
Testing
Verified via the original PR. The signing and notarization flow was validated interactively. No automated tests added as this can only be tested through the full pipeline run.
Risk
REQUIRED: Check exactly one box.
Significant pipeline changes to add Apple notarization support, but all changes are confined to build/signing pipeline templates and tooling. No runtime code changes.