Open sebj opened 3 months ago
@sebj, I can reproduce the problem. Using Sentry-Dynamic
via SPM works, though. Maybe you can switch to that while we are working on a fix.
I'm seeing the exact same error for my VisionOS builds 👀
I noticed that if you change SWIFT_OBJC_INTEROP_MODE
to objcxx
in the visionOS project, it works with Sentry static.
Its seems to me that Xcode is not linking with some c++ lib that it links by default for iOS projects, but I could not figure it out the root of the problem.
@armcknight can you give us a hand with this? You've work with C++ longer than us.
I'm currently investigating this.
I was unable to reproduce the workaround mentioned by @philipphofmann , in my test app, of linking Sentry-Dynamic
. @brustolin 's workaround did resolve the build errors, but that is not going to be a good solution unfortunately.
For the sake of comparison I created a test iOS app project with the same setup as the visionOS one, using SwiftUI, pulling in the Sentry SDK via SPM, validating that they have the same setting for SWIFT_OBJC_INTEROP_MODE
, and the issue does not appear.
Attached are the two projects I created to test.
Digging in further, there are a few differences in the ld
invocations between the projects, I'm not sure if this is relevant:
Ld /Users/andrewmcknight/Library/Developer/Xcode/DerivedD | Ld /Users/andrewmcknight/Library/Developer/Xcode/DerivedD
cd /Users/andrewmcknight/Desktop/experiments/iOS-SPM | cd /Users/andrewmcknight/Desktop/experiments/visionOS
/Applications/Xcode15.3/Xcode.app/Contents/Developer/ | /Applications/Xcode15.3/Xcode.app/Contents/Developer/
-Xlinker | -Xlinker
-reproducible | -reproducible
-target | -target
arm64-apple-ios17.4-simulator | arm64-apple-xros1.1
-isysroot | -isysroot
/Applications/Xcode15.3/Xcode.app/Contents/Developer/Plat | /Applications/Xcode15.3/Xcode.app/Contents/Developer/Plat
-O0 | -O0
-L/Users/andrewmcknight/Library/Developer/Xcode/DerivedDa | -L/Users/andrewmcknight/Library/Developer/Xcode/DerivedDa
-L/Users/andrewmcknight/Library/Developer/Xcode/DerivedDa | -L/Users/andrewmcknight/Library/Developer/Xcode/DerivedDa
-F/Users/andrewmcknight/Library/Developer/Xcode/DerivedDa | -F/Users/andrewmcknight/Library/Developer/Xcode/DerivedDa
-F/Users/andrewmcknight/Library/Developer/Xcode/DerivedDa | -F/Users/andrewmcknight/Library/Developer/Xcode/DerivedDa
-filelist | -F/Users/andrewmcknight/Library/Developer/Xcode/DerivedDa
/Users/andrewmcknight/Library/Developer/Xcode/DerivedData | -filelist
-Xlinker | /Users/andrewmcknight/Library/Developer/Xcode/DerivedData
-rpath | -Xlinker
-Xlinker | -rpath
@executable_path/Frameworks | -Xlinker
-dead_strip | /Users/andrewmcknight/Library/Developer/Xcode/DerivedData
-Xlinker | -Xlinker
-object_path_lto | -rpath
-Xlinker | -Xlinker
/Users/andrewmcknight/Library/Developer/Xcode/DerivedData | @executable_path/Frameworks
-Xlinker | -dead_strip
-export_dynamic | -Xlinker
-Xlinker | -object_path_lto
-no_deduplicate | -Xlinker
-Xlinker | /Users/andrewmcknight/Library/Developer/Xcode/DerivedData
-objc_abi_version | -Xlinker
-Xlinker | -export_dynamic
2 | -Xlinker
-fobjc-link-runtime | -no_deduplicate
-L/Applications/Xcode15.3/Xcode.app/Contents/Developer/To | -fobjc-link-runtime
-L/usr/lib/swift | -L/Applications/Xcode15.3/Xcode.app/Contents/Developer/To
-Xlinker | -L/usr/lib/swift
-add_ast_path | -Xlinker
-Xlinker | -add_ast_path
/Users/andrewmcknight/Library/Developer/Xcode/DerivedData | -Xlinker
-Xlinker | /Users/andrewmcknight/Library/Developer/Xcode/DerivedData
-sectcreate | -Wl,-no_warn_duplicate_libraries
-Xlinker | -framework
__TEXT | Sentry
-Xlinker | -Xlinker
__entitlements | -no_adhoc_codesign
-Xlinker | -Xlinker
/Users/andrewmcknight/Library/Developer/Xcode/DerivedData | -dependency_info
-Xlinker | -Xlinker
-sectcreate | /Users/andrewmcknight/Library/Developer/Xcode/DerivedData
-Xlinker | -o
__TEXT | /Users/andrewmcknight/Library/Developer/Xcode/DerivedData
-Xlinker | -Xlinker
__ents_der | -add_ast_path
-Xlinker | -Xlinker
/Users/andrewmcknight/Library/Developer/Xcode/DerivedData | /Users/andrewmcknight/Library/Developer/Xcode/DerivedData
-framework <
Sentry <
-Xlinker <
-no_adhoc_codesign <
-Xlinker <
-dependency_info <
-Xlinker <
/Users/andrewmcknight/Library/Developer/Xcode/DerivedData <
-o <
/Users/andrewmcknight/Library/Developer/Xcode/DerivedData <
Essentially, this is only in the iOS ld
invocation:
-Xlinker
-objc_abi_version
-Xlinker
2
-Xlinker
-sectcreate
-Xlinker
__TEXT
-Xlinker
-sectcreate
-Xlinker
__TEXT
-Xlinker
__ents_der
and this is only in the visionOS one:
-Wl,no_warn_duplicate_libraries
Maybe we need to add something to the cxxSettings
in our Package.swift, or tweak how we build the xcframework xrOS slice. Will need to dig into those further.
Platform
visionOS
Environment
Develop
Installed
Swift Package Manager
Version
8.22.4
Did it work on previous versions?
8.21.0
Steps to Reproduce
SentrySDK.start { .. }
(purely for testing purposes, I thew this intoonAppear
inContentView
in this fresh demo project)Expected Result
App builds and runs successfully on visionOS simulator
Actual Result
App fails to build and run on visionOS simulator.
Build errors:
Are you willing to submit a PR?
No response