Build and run natively on Apple Silicon (Xcode 26 / macOS 26)#1377
Open
mavliev wants to merge 1 commit into
Open
Build and run natively on Apple Silicon (Xcode 26 / macOS 26)#1377mavliev wants to merge 1 commit into
mavliev wants to merge 1 commit into
Conversation
- Raise deployment target 10.8 -> 11.0 (project.pbxproj + Podfile + post_install hook). 10.8 required the removed libarclite and was the only build blocker. - Fix latent out-of-bounds toolbar array reads in MPToolbarController.m that crashed at launch under the arm64 Release optimizer. - Modernize 14 deprecated API uses across 7 files (NSAutoPagination, NSFileHandlingPanelOKButton, NSOnState, insertText:replacementRange:, secure NSKeyedUnarchiver, colorUsingColorSpace:, file-URL drag pasteboard). Secure unarchiving verified to decode the .map resources identically. - Add MacDown/MacDown.entitlements (hardened-runtime compatible) for notarization-ready distribution builds. Legacy WebView/DOMNode deprecations deferred (need a WKWebView migration). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Just an FYI: there already is a fork, that is being maintained: https://github.com/schuyler/macdown3000
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MacDown currently fails to build with modern Xcode because the project's deployment
target is macOS 10.8, which requires
libarclite(removed in Xcode 14+). This PR makesMacDown build and run as a native arm64 app on Apple Silicon with current toolchains,
using minimal, surgical changes.
Tested on Apple M2, macOS 26, Xcode 26.3, CocoaPods 1.16.2.
Changes
the Podfile, plus a
post_installhook so the generated Pods project keeps the sametarget. This is the only change required to fix the
libarclitebuild failure.MPToolbarController.m:spaceAfterIndices[]and
flexibleSpaceAfterIndices[]were indexed without bounds checks. This was benignunder the old x86_64 toolchain, but the arm64 Release optimizer made it crash at launch
in
toolbarDefaultItemIdentifiers:. Added bounds guards (behavior-preserving).NSAutoPagination->NSPrintingPaginationModeAutomaticNSFileHandlingPanelOKButton->NSModalResponseOKNSOnState->NSControlStateValueOn-insertText:->-insertText:replacementRange:+unarchiveObjectWithFile:-> secure+unarchivedObjectOfClasses:fromData:error:(verified to decode
data.map/treats.mapidentically)colorUsingColorSpaceName:->colorUsingColorSpace:NSPasteboardTypeFileURL+readObjectsForClasses:options:(also fixes a
registerForDraggedTypes:that registered a pasteboard name, not a type)MacDown/MacDown.entitlements(hardened-runtime compatible) to supportnotarization-ready distribution builds.
Not included (intentionally, to keep this focused)
WebView/DOMNode->WKWebViewmigration. Those APIs are deprecated butstill function; migrating is a larger change best left to a separate PR.
Testing
includes a native arm64 slice.
Code Type: ARM64, not under Rosetta).🤖 Generated with Claude Code