Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
build: strip signature from compiled macOS base binary
Browse files Browse the repository at this point in the history
Newer versions of Apple Clang automatically ad-hoc sign the compiled
executable, due to the new mandatory code signing requirement [1].

However, for final executable to be signable, base binary MUST NOT
have an existing signature.

This change strips the ad-hoc signature from compiled macOS base binary.

[1]: https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-universal-apps-release-notes

Refs: vercel/pkg#1164
Bug: vercel/pkg#1023
  • Loading branch information
jesec committed May 10, 2021
1 parent 25b257c commit a062bb4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ async function compileOnUnix(
stdio: 'inherit',
});

if (targetPlatform === 'macos') {
// Newer versions of Apple Clang automatically ad-hoc sign the compiled executable.
// However, for final executable to be signable, base binary MUST NOT have an existing signature.
await spawn('codesign', ['--remove-signature', output], {
stdio: 'inherit',
});
}

return output;
}

Expand Down

0 comments on commit a062bb4

Please sign in to comment.