A fix for debugging shared precompiled binaries from Carthage.
error: Couldn't IRGen expression, no additional error
./build.sh --platform ios MyCoolFramework
| #!/bin/sh -e | |
| XCCONFIG=$(mktemp /tmp/static.xcconfig.XXXXXX) | |
| trap 'rm -f "$XCCONFIG"' INT TERM HUP EXIT | |
| echo "SWIFT_SERIALIZE_DEBUGGING_OPTIONS = NO" >> $XCCONFIG | |
| export XCODE_XCCONFIG_FILE="$XCCONFIG" | |
| carthage build "$@" |
@aakarsh-sasi Did you solve your issue? I'm facing exactly the same thing and I can't get my username out of the BCSymbolMaps files.
@psolt-gpsw I did everything, every kind of clean, but my username still shows up as path.
I even checked the Carthage build log, and its passing the two variables correctly, even on swiftc.
I'm using Xcode 13.2 btw.
@caioremedio no I couldn’t fix the path after multiple trials and then I gave up in the end. If using both the flag solved this, would have saved a lot of time
@caioremedio I fixed our issue. Bumping the Facebook SDK version was important to make it different from previously used versions on our developer's machines. Otherwise, it may still reference the old build from the previous UUID and the hard-coded paths.
Did you walk through all of my steps?
@psolt-gpsw anyway to cleanup those paths without doing a version bump?
Make sure you delete all Carthage cached data and Xcode DerivedData before building, or I have found it may corrupt the build.
You need to also remove any offending library that still linked to your build paths by searching and deleting (empty trash) – if that's not possible you may need to do what Strava did.
I was able to test if it worked by deleting all the Carthage build folders and cache folder
rm -rf ~/Library/Caches/org.carthage.CarthageKit rm -rf CarthageAll I had to do was set a breakpoint in another internal framework/library that we had in the app, in lldb run
po self– if that failed due to IRGen, then the issue wasn't fixed.lldb
image listhelped me see where it's loading from.(lldb) image list [ 0] B430E131-7C63-32B0-B7F1-F937935A9C10 0x0000000102df4000 /Users/psolt/Library/Developer/Xcode/DerivedData/AppName-cgccgwlpvbsiwfhggackekkmufqs/Build/Products/Debug-iphoneos/AppName.app/AppName /Users/psolt/Library/Developer/Xcode/DerivedData/AppName-cgccgwlpvbsiwfhggackekkmufqs/Build/Products/Debug-iphoneos/AppName.app.dSYM/Contents/Resources/DWARF/AppName [ 1] 1F4D7499-EE60-3C5D-9D54-2CD29E4E537C 0x00000001070dc000 /Users/psolt/Library/Developer/Xcode/iOS DeviceSupport/14.4.2 (18D70) arm64e/Symbols/usr/lib/dyld [ 2] 5B7E6F77-8C66-315F-9282-98895A6EBE31 0x00000001076fc000 /Users/psolt/Library/Developer/Xcode/DerivedData/AppName-cgccgwlpvbsiwfhggackekkmufqs/Build/Products/Debug-iphoneos/AppName.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit /System/Volumes/Data/Users/psolt/dev/Facebook/FacebookSDK/Carthage/Build/FBSDKCoreKit.xcframework/ios-arm64_armv7/dSYMs/FBSDKCoreKit.framework.dSYM/Contents/Resources/DWARF/FBSDKCoreKit ...The key is looking for where it loads the framework, which is that indented path for each entry:
/System/Volumes/Data/Users/psolt/dev/Facebook/FacebookSDK/Carthage/Build/FBSDKCoreKit.xcframework/ios-arm64_armv7/dSYMs/FBSDKCoreKit.framework.dSYM/Contents/Resources/DWARF/FBSDKCoreKitYou can track down these unexpected locations of dSYM files if they're problematic for the architecture you're building:
5B7E6F77-8C66-315F-9282-98895A6EBE31), which you use to track down locations:Find those locations by UUID, older versions (with hard coded paths) may still be present on your machine, which you'll need to remove.
mdfind "com_apple_xcode_dsym_uuids == 5B7E6F77-8C66-315F-9282-98895A6EBE31" /Users/psolt/dev/codereview/libs/public/ios/FacebookSDK-ios/local 9.1.0 ios only/FBSDKCoreKit.xcframework/ios-arm64_armv7/dSYMs/FBSDKCoreKit.framework.dSYM /Users/psolt/dev/codereview/libs/public/ios/FacebookSDK-ios/FBSDKCoreKit.xcframework/ios-arm64_armv7/dSYMs/FBSDKCoreKit.framework.dSYM /Users/psolt/dev/Facebook/FacebookSDK/Carthage/Build/FBSDKCoreKit.xcframework/ios-arm64_armv7/dSYMs/FBSDKCoreKit.framework.dSYMimage list) you will see path issues on another development machine, or if you clear your build folders for Carthage/Xcode derived data.NOTE: If there are no library code changes, the UUID may be the same value between builds. I bumped our Facebook SDK version to prevent this apparent issue, but that might not be possible depending on the library you're using (see what Strava did).