Skip to content

fix(release): strip Mach-O signature before patchver on apple targets#35897

Merged
bartlomieju merged 2 commits into
mainfrom
promote-strip-macho-signature
Jul 9, 2026
Merged

fix(release): strip Mach-O signature before patchver on apple targets#35897
bartlomieju merged 2 commits into
mainfrom
promote-strip-macho-signature

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

rcodesign fails signing the x86_64-apple-darwin deno binary during LTS/RC
promotion with "__LINKEDIT segment contains data after signature".

patchver runs as a Wasm module. libsui used to strip an Intel Mach-O's
existing code signature before injecting a section by shelling out to
codesign, but that path is gated to Apple hosts and is absent from the
wasm32 build, so patchver appends the channel section after the stale
signature and leaves data in __LINKEDIT past the signature that rcodesign
refuses to parse. arm64 is unaffected because that path rebuilds the
binary through the in-memory signer.

The promotion job runs on a macOS runner, so strip the signature with
native codesign --remove-signature before patchver for apple targets.
patchver then writes into an unsigned binary and rcodesign re-signs it
cleanly.

Stacked on #35893 (min-dep-age) so both promote fixes are testable
together; retarget to main once that merges.

Deno applies a default minimum-dependency-age when resolving jsr
dependencies, refusing versions published more recently than ~1 day
ago. The promotion scripts import @deno/patchver, which is typically
bumped and republished right before a promotion, so the freshly
published version is always "too new" and the run aborts:

    error: Could not find version of '@deno/patchver' that matches '0.5.1'
    A newer matching version was found, but it was not used because it
    was newer than the specified minimum dependency date

These scripts only pull first-party and @std dependencies (@deno/
patchver, @david/dax, @std/fmt), so the supply-chain age gate that
protects user projects from freshly compromised third-party packages
does not apply. Pass --minimum-dependency-age=0 to both promote
`deno run` invocations so a just-published patchver can be used.
rcodesign fails signing the x86_64-apple-darwin deno binary during
promotion with "__LINKEDIT segment contains data after signature".

patchver runs as a Wasm module. libsui used to strip an Intel Mach-O's
existing code signature before injecting a section by shelling out to
`codesign`, but that path is gated to Apple hosts and is absent from the
wasm32 build. So patchver appends the channel section after the stale
signature, leaving data in __LINKEDIT past the signature that rcodesign
refuses to parse. arm64 is unaffected because that path rebuilds the
binary through the in-memory signer.

The promotion job runs on a macOS runner, so strip the signature with
native `codesign --remove-signature` before patchver for apple targets.
patchver then writes into an unsigned binary and rcodesign re-signs it
cleanly.
Base automatically changed from promote-disable-min-dep-age to main July 9, 2026 08:16
@bartlomieju
bartlomieju merged commit 817449a into main Jul 9, 2026
137 checks passed
@bartlomieju
bartlomieju deleted the promote-strip-macho-signature branch July 9, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant