Skip to content

fix(macos): honor caller-supplied CMAKE_OSX_ARCHITECTURES - #101

Open
aleclarson wants to merge 1 commit into
NativeScript:mainfrom
aleclarson:macos-honor-osx-architectures
Open

aleclarson wants to merge 1 commit into
NativeScript:mainfrom
aleclarson:macos-honor-osx-architectures

Conversation

@aleclarson

Copy link
Copy Markdown

Summary

The macos branch of NativeScript/CMakeLists.txt unconditionally sets CMAKE_OSX_ARCHITECTURES to arm64. That normal variable shadows a -DCMAKE_OSX_ARCHITECTURES=... cache value, so the macOS framework can't be built for Intel Macs, even though the bundled libffi/macosx-universal already has an x86_64 slice, TARGET_PLATFORM_SPEC is macos-arm64_x86_64, and scripts/metagen.js already has an x86_64 macOS target.

This keeps arm64 as the default and only uses it when the caller hasn't chosen architectures.

Evidence

In Octane Xplat's AppKit host, we built the TARGET_PLATFORM=macos, TARGET_ENGINE=none, NS_FFI_BACKEND=napi framework with CMAKE_OSX_ARCHITECTURES=x86_64 and this one-line change, on an arm64 Mac with Xcode 27. We embedded x86_64 metadata generated with -target x86_64-apple-macos11.0. The resulting x86_64 NativeScript.framework ran a minimal AppKit app to completion on a real Intel Mac (macOS 15.7.7). Default builds without -DCMAKE_OSX_ARCHITECTURES are unchanged.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ed72fd7-02b7-43c4-a7b8-cbef4a8da287

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

aleclarson added a commit to octane-xplat/octane-xplat that referenced this pull request Oct 29, 2026
The AppKit host, NativeScript framework, Mason engine and app native leaves
now ship arm64 and x86_64 slices, with per-architecture SDK metadata selected
by the host. Packages land in artifacts/macos-universal/, and prebuilt
dylibs must contain both slices. The runtimes patch carries the macOS
architecture fix proposed upstream in NativeScript/runtimes#101.

BREAKING CHANGE: macOS artifacts move from artifacts/macos-arm64/ to
artifacts/macos-universal/ (<Name>-macos-universal.dmg), and packages'
prebuiltLibraries must be universal binaries.

This branch has not been deployed

No deployments
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