Skip to content

thomasflad/tuist-xcframework-embed-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tuist: Dynamic binary XCFramework not embedded

Minimal reproduction for a Tuist bug where a dynamic binary XCFramework from an SPM package is linked but not added to the "Embed Frameworks" build phase.

Related issues: tuist/tuist#8799, tuist/tuist#8056

Environment

  • Tuist 4.174.2
  • Xcode 26.3
  • macOS 26.4

The problem

When an SPM package exposes a .binaryTarget directly as its product (no source wrapper target), Tuist links the XCFramework but does not embed it. The app crashes at launch:

dyld: Library not loaded: @rpath/powersync-sqlite-core.framework/powersync-sqlite-core

This affects any SPM package structured like:

products: [
    .library(name: "Foo", targets: ["Foo"])
],
targets: [
    .binaryTarget(name: "Foo", url: "...", checksum: "...")
]

Packages that use a source wrapper target around the binary target (like OneSignal-XCFramework) are embedded correctly.

Steps to reproduce

tuist install
tuist generate --no-open

# Build
xcodebuild build \
  -workspace PowerSyncRepro.xcworkspace \
  -scheme App \
  -destination 'platform=iOS Simulator,OS=latest,name=iPhone 16 Pro'

# Verify: framework is NOT in app bundle
ls ~/Library/Developer/Xcode/DerivedData/PowerSyncRepro-*/Build/Products/Debug-iphonesimulator/App.app/Frameworks/
# -> empty or missing

# Launch -> crash
xcrun simctl install booted ~/Library/Developer/Xcode/DerivedData/PowerSyncRepro-*/Build/Products/Debug-iphonesimulator/App.app
xcrun simctl launch --console-pty booted com.test.powersync-repro
# -> dyld: Library not loaded: @rpath/powersync-sqlite-core.framework/powersync-sqlite-core

Expected behavior

The dynamic XCFramework should appear in the "Embed Frameworks" build phase and be copied into App.app/Frameworks/.

Notes

  • The XCFramework binary is confirmed dynamic: file reports "Mach-O 64-bit dynamically linked shared library"
  • Xcode's Run action masks this bug because it injects DYLD_FRAMEWORK_PATH pointing to the build products directory — but release/archive builds and simctl launch will crash
  • productTypes: ["PowerSyncSQLiteCore": .framework] in PackageSettings has no effect on binary targets

About

Minimal reproduction: Tuist does not embed dynamic binary XCFrameworks from SPM packages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages