Skip to content

fix(swift-sdk): produce versioned bundle layout for macOS xcframework - #665

Merged
i386 merged 1 commit into
Mesh-LLM:mainfrom
keranm:fix/xcframework-versioned-bundle-macos
May 24, 2026
Merged

fix(swift-sdk): produce versioned bundle layout for macOS xcframework#665
i386 merged 1 commit into
Mesh-LLM:mainfrom
keranm:fix/xcframework-versioned-bundle-macos

Conversation

@keranm

@keranm keranm commented May 24, 2026

Copy link
Copy Markdown
Contributor

fix(swift-sdk): produce versioned bundle layout for macOS xcframework

macOS requires framework bundles to use a Versions/A/ directory structure with top-level symlinks. Flat bundles — where Info.plist sits at the framework root — are rejected by the macOS dynamic linker at load time.

Both build scripts were creating flat bundles for all platforms, which works on iOS/simulator/Catalyst but breaks on macOS. This caused the xcframework to fail when consumed by an Xcode project.

Changes:

  • build-xcframework.sh: split create_framework() into a versioned path for macos and a flat path for iOS/sim/catalyst; Info.plist and PrivacyInfo.xcprivacy move into
    Versions/A/Resources/; add the five canonical Versions/Current symlinks; use cp -RP (not cp -R) in the xcodebuild fallback so symlinks are preserved
  • build-host-macos-xcframework.sh: same versioned layout applied to the inline macOS framework construction

macOS requires framework bundles to use the Versions/A/ directory structure
with top-level symlinks (Versions/Current, Headers, Modules, Resources).
Flat bundles — where Info.plist sits at the framework root and there is no
Versions/ tree — are rejected by the macOS dynamic linker at load time.

Both build scripts were creating flat bundles for every platform, which
works on iOS/simulator/Catalyst but breaks on macOS. This caused the
xcframework to fail when consumed by an Xcode project on macOS.

Changes:
- build-xcframework.sh: split create_framework() into a versioned path for
  "macos" and a flat path for iOS/sim/catalyst; move Info.plist and
  PrivacyInfo.xcprivacy into Versions/A/Resources/ for the macOS slice;
  add the five canonical Versions/Current symlinks; use cp -RP (not cp -R)
  when copying the macOS framework in the xcodebuild fallback path so that
  symlinks are preserved rather than dereferenced.
- build-host-macos-xcframework.sh: apply the same versioned layout to the
  inline macOS framework construction; cp -R → cp -RP for the xcframework
  assembly step.

@i386 i386 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM and congrats on your first contribution @keranm!

@i386
i386 merged commit cceb2eb into Mesh-LLM:main May 24, 2026
11 checks passed
michaelneale added a commit that referenced this pull request May 24, 2026
* origin/main:
  Honor direct chat no-think requests (#647)
  fix(swift-sdk): produce versioned bundle layout for macOS xcframework (#665)
  Update llama.cpp upstream pin
  Fix native SDK runtime crate packaging (#664)
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.

2 participants