0
  • Are your carthage dependencies checked in?: YES
  • carthage install method: [ ] .pkg, [x] homebrew, [ ] source
  • which carthage: /usr/local/bin/carthage
  • carthage version: 0.38.0
  • xcodebuild -version: Xcode 12.5, Build version 12E262
  • Are you using --no-build? NO
  • Are you using --no-use-binaries? YES
  • Are you using --use-submodules? NO
  • Are you using --cache-builds? NO
  • Are you using --new-resolver? YES
  • Are you using --use-xcframeworks? YES

Cartfile

binary "https://raw.githubusercontent.com/Snapchat/snap-kit-carthage/repo/SCSDKCreativeKit.json"    == 1.6.5
binary "https://raw.githubusercontent.com/Appboy/appboy-ios-sdk/master/appboy_ios_sdk.json"         == 4.3.2
github "SDWebImage/SDWebImage"                                                                      "5.8.2"
github "https://github.com/SourcePointUSA/ios-cmp-app.git"                                          "5.2.3"
github "facebook/facebook-ios-sdk"                                                                  "v9.2.0"

github "google/promises"                                                                            "1.2.12"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseABTestingBinary.json"                == 7.4.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json"             == 7.4.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebasePerformanceBinary.json"              == 7.4.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"                == 7.4.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseDynamicLinksBinary.json"             == 7.4.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseCrashlyticsBinary.json"              == 7.4.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseGoogleSignInBinary.json"             == 7.4.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseProtobufBinary.json"                 == 7.4.0

Carthage Output

Builds fine

Actual outcome po in the console does not work. It errors with:

error: virtual filesystem overlay file '/Users/<username>/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5.1_12E507/facebook-ios-sdk/v9.2.0/Build/Intermediates.noindex/FBSDKCoreKit.build/Release-iphonesimulator/FBSDKCoreKit-Dynamic.build/all-product-headers.yaml' not found

error: couldn't IRGen expression. Please check the above error messages for possible root causes.

Expected outcome po should work.

I've come across past issues, which seem similar to mine but they seem to be from a long time ago. From my understanding, this could be caused by the fact that we have the Carthage dependencies checked into the repo. The Carthage binaries contain absolute paths to the last developers machine that ran carthage bootstrap / update, as can be seen from the error log above. From reading a few articles, such as this one, it seems that checking in the dependencies is not a good idea since we pass --no-use-binaries. Could someone confirm this as bad practice? I see mixed advice on whether to check the dependencies in.

Since not checking in the dependencies implies caching them on CI, it would be quite a disruptive change that I'd like to avoid if there's any decent workarounds. I've tried git ignoring (and git rm ing) the .bcsymbolmap and .dSYM files that come with the dependencies, since a search shows that this is where the absolute paths can be found but this doesn't fix the issue.

The only thing that seems to work is building the dependencies again locally using carthage.

ps: this started as an Issue on the Carthage repo but seems more like a SO questions

Remover
  • 1,616
  • 1
  • 17
  • 27
  • Run `carthage update` this should resolve this – Mickael Belhassen Oct 26 '21 at 17:05
  • Due to the way Swift debug information is currently emitted, in order to reconstruct the debug information for a Swift module that imports any C/ObjC headers into Swift, the debugger (or anybody else who needs to do this) has to locally rebuild the clang modules that were used to import that code into swift. That means the files that were part of the build need to be available locally, which is generally only possible if the debugger can access a local build tree. – Jim Ingham Oct 29 '21 at 18:02

1 Answers1

1

I faced up many times with the same error. For a long time, I also wasn't finding a solution. But after some new searching I solved this problem using the next command:

carthage update --platform iOS --no-use-binaries

It works for me in every project where using carthage. For more details, you can look at this question

igdev
  • 341
  • 1
  • 4
  • 15
  • I realise that you can just rebuild the dependencies. But the problem is that we are sharing them. I am looking for a workaround that would mean we don’t need to stop sharing the dependencies. Running update would mean that each developer would have changes in their git repository. I would like to avoid that if possible – Remover Oct 27 '21 at 19:24
  • In my team, we had only the Realm that was included via `carthage`. Fortunately, we had the ability to move to CocoaPods this dependency. But if you have a lot of dependencies via `carthage` the migration for you may not be possible or easy – igdev Oct 27 '21 at 21:34