johnno1962 / HotReloading

Hot reloading as a Swift Package
MIT License
562 stars 49 forks source link

Xcode 15 beta link SwiftTrace failed #84

Closed qmkCamel closed 1 year ago

qmkCamel commented 1 year ago

Hi, I use the HotReloading as a package in my project. When I try it with the Xcode 15 beta, found the SwiftTrace link failed.

clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)

I see the project has adapted with Xcode 15 beta. So, did I need make some extra build setting on the project ? Thanks~

I test it with 4.11.16 on an empty demo project, and the command is as below.

    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target arm64-apple-ios12.0 -dynamiclib -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -O0 -L/Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphoneos -L/Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Products/Debug-iphoneos/PackageFrameworks -L/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib -F/Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphoneos -F/Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Products/Debug-iphoneos/PackageFrameworks/PackageFrameworks -F/Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Products/Debug-iphoneos/PackageFrameworks/PackageFrameworks -F/Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Products/Debug-iphoneos/PackageFrameworks -F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -iframework /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -iframework /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/Developer/Library/Frameworks -filelist /Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Intermediates.noindex/SwiftTrace.build/Debug-iphoneos/SwiftTrace\ product.build/Objects-normal/arm64/SwiftTrace.LinkFileList -install_name @rpath/SwiftTrace.framework/SwiftTrace -Xlinker -rpath -Xlinker /usr/lib/swift -dead_strip -Xlinker -object_path_lto -Xlinker /Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Intermediates.noindex/SwiftTrace.build/Debug-iphoneos/SwiftTrace\ product.build/Objects-normal/arm64/SwiftTrace_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-link-runtime -L/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/usr/lib/swift -Xlinker -rpath -Xlinker /Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Products/Debug-iphoneos/PackageFrameworks/PackageFrameworks -lc++ -Xlinker -rpath -Xlinker /Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Products/Debug-iphoneos/PackageFrameworks/PackageFrameworks -Xlinker -dependency_info -Xlinker /Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Intermediates.noindex/SwiftTrace.build/Debug-iphoneos/SwiftTrace\ product.build/Objects-normal/arm64/SwiftTrace_dependency_info.dat -o /Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Products/Debug-iphoneos/PackageFrameworks/SwiftTrace.framework/SwiftTrace -Xlinker -add_ast_path -Xlinker /Users/camel/Library/Developer/Xcode/DerivedData/BetaXcodeApp-euxtxbekqbyurifpuhqfctmliuqi/Build/Intermediates.noindex/SwiftTrace.build/Debug-iphoneos/SwiftTrace.build/Objects-normal/arm64/SwiftTrace.swiftmodule
johnno1962 commented 1 year ago

Hi, yes there seems to be a problem with the linker for a real device build. I've filed a bug report and we'll have to wait to see if they fix it.

johnno1962 commented 1 year ago

My FB was FB12302179 if you want to raise another one and refer to it.

johnno1962 commented 1 year ago

Hi, have you checked to see if this is still an issue with beta3 yet? I'm away from my Ventura machine till next week. See also: https://github.com/johnno1962/SwiftTrace/issues/46

qmkCamel commented 1 year ago

I missed the message these days. The link problem seems have a workaround from https://github.com/johnno1962/SwiftTrace/issues/46

johnno1962 commented 1 year ago

Interesting. You're saying this linker problem has been fixed by removing the class in https://github.com/johnno1962/SwiftTrace/issues/46? Seems to be some problem in clang then. Thanks, I'll update the FB.

qmkCamel commented 1 year ago

I didn't test fix it myself, and the error message is the same with https://github.com/johnno1962/SwiftTrace/issues/46.. So, I think the problem is the same. And, by the way, how can I see the detail info with your FB number? I am new to the FB, and searched the net but didn't find a way to get your FB detail info. Thanks~

johnno1962 commented 1 year ago

FBs are all private so you won't be able to search for it. Seems like these two problems are related though there is now a better diagnostic. I'll have a chance to look at it tomorrow. The good news is it seems like there is a workaround for now.

johnno1962 commented 1 year ago

I've merged the change to remove the problem class onto HotReloading/main and rolled a new release candidate https://github.com/johnno1962/InjectionIII/releases/tag/4.7.1 if you want to try it out with these various issues resolved.