Skip to content

Add native macOS arm64 build script and docs - #457

Open
MoustacheOff wants to merge 3 commits into
CauldronDevelopmentLLC:masterfrom
MoustacheOff:macos-arm64-build
Open

MoustacheOff wants to merge 3 commits into
CauldronDevelopmentLLC:masterfrom
MoustacheOff:macos-arm64-build

Conversation

@MoustacheOff

@MoustacheOff MoustacheOff commented Oct 8, 2026 •

Copy link
Copy Markdown

What

  • scripts/build-macos-arm64: builds C! and CAMotics natively for Apple Silicon using Homebrew (scons, qt@5), then assembles dist/CAMotics.app (Qt bundled via osx/deployqt, ad-hoc signed).
  • README: new "Building on macOS (Apple Silicon)" section.
  • .gitignore: ignore /dist/ and /cbang/.

Why

There was no documented way to build on current macOS/M-series. Tested on macOS 27 / M4 from a clean clone: all binaries are arm64, the app launches, and camsim simulates examples/bear (406k triangles in ~2.6s).

Notes for reviewers

  • TPL is disabled (with_tpl=0): Homebrew's V8 15.x needs C++20 and its API no longer matches the C! V8 bindings.
  • Qt 5.15 is deprecated in Homebrew (disabled 2027-05-19); the bundle ships its own frameworks.
  • Min macOS version defaults to 14.0, overridable as the script's first argument.
  • No Developer ID signing/notarization.

Related to #456 (asks for an Apple Silicon build; this documents building one from source, it does not provide an official release).

Copilot AI balanced review requested due to automatic review settings October 8, 2026 10:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@lk-da-miller lk-da-miller left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Built as described on my MacBook Pro with M4 and macOS Golden Gate 27.2. Build succeeds but crashes upon launch.

Crash report.pdf

scripts/build-macos-arm64 builds C! and CAMotics natively for Apple Silicon
with Homebrew Qt5 and packages a signed CAMotics.app. TPL is disabled because
Homebrew's V8 is newer than the C! V8 bindings.
macdeployqt does not copy indirect @rpath dependencies, so libbrotlicommon
was missing from the bundle and the Qt cocoa platform plugin failed to load.
The build script now copies any unresolved @rpath dylibs into Frameworks.

config/qt5 no longer imports six (Python 3 only), which current Homebrew
scons does not ship.
@MoustacheOff

Copy link
Copy Markdown
Author

Thanks @lk-da-miller, I reproduced the crash on macOS 27.2 / M4 and pushed a fix.

Cause: macdeployqt doesn't copy indirect @rpath dependencies. libbrotlidec references libbrotlicommon.1.dylib, which was missing from the bundle, so the Qt cocoa platform plugin failed to load and the app aborted at launch.

Fix: the script now copies any unresolved @rpath dylibs into Contents/Frameworks before signing. I also removed the six import from config/qt5, since current Homebrew scons no longer ships it and a fresh build failed on it.

After a clean rebuild with scripts/build-macos-arm64 the app launches with no crash report. Could you pull the branch and try again? If it still crashes, the output of QT_DEBUG_PLUGINS=1 dist/CAMotics.app/Contents/MacOS/camotics would help.

@lk-da-miller

Copy link
Copy Markdown

Thanks @MoustacheOff !! It works! Very helpful since I use Camotics quite a bit. Thank you so much!

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.

3 participants