fix(build): re-sign macOS arm64 builds after flipping the nodeCliInspect fuse by Jocs · Pull Request #5664 · marktext/marktext · GitHub
Skip to content

fix(build): re-sign macOS arm64 builds after flipping the nodeCliInspect fuse - #5664

Merged
Jocs merged 2 commits into
developfrom
fix/macos-arm64-adhoc-signing
Oct 8, 2026
Merged

Jocs merged 2 commits into
developfrom
fix/macos-arm64-adhoc-signing

Conversation

@Jocs

@Jocs Jocs commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Closes #5611

Summary

Backports the v0.21.1 hotfix to develop so 0.22.0 is not affected, and corrects the macOS quarantine command in the release-note template.

Crash: #5643 added electronFuses, and flipping a fuse rewrites the Electron Framework binary, invalidating the ad-hoc signature its linker wrote. The macOS build is never re-signed (skipped macOS application code signing … 0 identities found), so the v0.21.0 arm64 app was killed at launch with EXC_BAD_ACCESS (Code Signature Invalid).

Fix: resetAdHocDarwinSignature: true makes @electron/fuses re-sign the app ad-hoc (codesign --sign - --deep) immediately after flipping the fuse.

Note fix: the note told users to run xattr -cr /Applications/marktext.app — a path that no longer exists after the app rename (#5202), so the documented command always failed. It now reads xattr -d com.apple.quarantine /Applications/MarkText.app.

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

  • New tests added (or explain why not needed)
    • Not needed: configuration and release-note text only, verified by rebuilding the app.
  • Manually tested on: macOS

Notes for reviewers [optional]

xattr -d com.apple.quarantine <app> is preferred over xattr -cr <app>:

  • it deletes only the attribute that blocks launch, rather than clearing every extended attribute on the bundle;
  • it avoids -r, which is exactly what [Bug] For Macs, xattr commandline is incorrect... #5611 reported as unsupported (option -r not recognized), so it works whichever xattr variant is on the user's PATH;
  • verified locally: exits 0 and removes only com.apple.quarantine when it is present. When the flag has already been cleared it prints No such xattr: com.apple.quarantine — harmless, since the goal state is already reached.

Verified locally on arm64: pnpm run build:mac:arm64 produces a bundle whose Electron Framework verifies as valid on disk, and the built app launches without the code-signing kill. The same change shipped as v0.21.1.


By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

@Jocs
Jocs force-pushed the fix/macos-arm64-adhoc-signing branch 2 times, most recently from 0e7a4a6 to 585b429 Compare October 8, 2026 16:24
@Jocs
Jocs force-pushed the fix/macos-arm64-adhoc-signing branch from 585b429 to 4cec640 Compare October 8, 2026 16:28
The note pointed at /Applications/marktext.app, which no longer exists after
the app rename (#5202), and cleared every extended attribute. Point at the
real path and delete only com.apple.quarantine (#5611).
@Jocs
Jocs force-pushed the fix/macos-arm64-adhoc-signing branch from 4cec640 to e608fdc Compare October 8, 2026 16:35
@Jocs
Jocs merged commit c5b8bab into develop Oct 8, 2026
11 checks passed
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.

[Bug] For Macs, xattr commandline is incorrect...

1 participant