I've posted the same question on Apple Forums, but didn't get any response. Hope that is ok :)
I've created a sample Swift package which uses binaryTarget
to add local XCFramework dependency to a package. XCFramework itself contain two static libraries: One for iOS simulator, and one for iOS device. The result is that Xcode crashes and the package manager fails with zsh: trace trap
/ Error 4 on the command line:
Here is sample project download site:
Here is an output from the M1:
gitlab@Gitlabs-Mac-mini Xcode-Crashes % swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios15.0-simulator" -v
/usr/bin/xcrun --sdk macosx --show-sdk-platform-path
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -print-target-info
/usr/bin/xcrun --sdk macosx --find xctest
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -print-target-info
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -print-target-info -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -print-target-info
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -emit-supported-features /var/folders/vq/_xcbbgg5605dppl019n65nj00000gn/T/TemporaryDirectory.Ga9HOY/dummyInput-1.swift
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -print-target-info
/usr/bin/xcrun vtool -show-build /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI/libPackageDescription.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -lPackageDescription -Xlinker -rpath -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -target arm64-apple-macosx11.0 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -swift-version 5 -I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -package-description-version 5.5.0 /Users/gitlab/Downloads/Xcode-Crashes/Package.swift -Xfrontend -disable-implicit-concurrency-module-import -o /var/folders/vq/_xcbbgg5605dppl019n65nj00000gn/T/TemporaryDirectory.m6GXvH/xcode-crashes-manifest
/usr/bin/sandbox-exec -p '(version 1)
(deny default)
(import "system.sb")
(allow file-read*)
(allow process*)
(allow file-write*
(subpath "/Users/gitlab/Library/Caches/org.swift.swiftpm/manifests")
)
' /var/folders/vq/_xcbbgg5605dppl019n65nj00000gn/T/TemporaryDirectory.m6GXvH/xcode-crashes-manifest -fileno 8
zsh: trace trap swift build -Xswiftc "-sdk" -Xswiftc -Xswiftc "-target" -Xswiftc -v
I've tested it on both M1 and Intel Mac machines and both of them are crashing.
The xcframework I used is consisting from static libraries built for both simulator and device. Tried with device library only but it still not working.