-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build errors with nested dependencies and --use-xcframeworks #3122
Comments
What I forgot to mention: If I move the correctly built |
I think this is because I am having the same issue with |
Hello. I am running into the same issue in developing the braintree-ios-drop-in SDK. It seems like we'll need to wait for Carthage to resolve this.
Can I ask - after you move the correctly built AppAuth_iOS framework into Carthage/Build/iOS, how are you then re-building the pace-cloud-sdk? |
@scannillo I just ran the But to be honest, we switched over to SPM as recommended integration. |
I've been hitting this as well with one of our private dependencies, and think I may have found the cause, at least for my case. The PR for XCFrameworks says:
I built Carthage from source so I could debug, and looks like this not working in all cases, as it's not extracting the frameworks to a temp directory when I build my dependencies. This is where it's failing - https://github.com/Carthage/Carthage/blob/master/Source/CarthageKit/Xcode.swift#L842 guard let platformTripleOS = settings.platformTripleOS.value,
let frameworkSearchPaths = settings.frameworkSearchPaths.value,
frameworkSearchPaths.contains(where: isRelativeToBuildDirectory) else {
// Skip extracting xcframeworks if this project doesn't declare its OS triple, or if it doesn't link
// against any frameworks in Carthage/Build.
return SignalProducer(value: nil)
} Specifically the let isRelativeToBuildDirectory = { (url: URL) in
url.resolvingSymlinksInPath().path.starts(with: buildDirectory.resolvingSymlinksInPath().path)
} The
So I'm assuming it fails because while YMMV, but a workaround in my case was to |
I have some findings. I am observing the Seems Carthage needs to copy corresponding arch There should be some issues so that the project cannot be built as missing linking framework. Maybe adding the scripts to copy to that directory works! So that no need to manually link with Xcode. |
|
@zachwaugh thanks for investigating, I can reproduce this and can confirm your workaround! At this line, Carthage/Source/CarthageKit/Xcode.swift Line 838 in 0668de4
we assume that resolvingSymlinksInPath() will resolve a path like Carthage/Build/iOS, even if it doesn't exist. I can't find documentation in Foundation about what happens when you try to resolve a nonexistent path, but the realpath(3) POSIX call says:
I would guess we're hitting those semantics, and will need to rethink this line. So: this bug leads to build errors under --use-xcframeworks, and you can work around it by creating platform-specific directories, like: |
…irectory Projects may search a directory like Carthage/Build/iOS, but under --use-xcframeworks that platform-specific folder ("iOS") might not exist. resolvingSymlinksInPath() follows realpath(3) semantics and will not resolve symlinks in the components of a non-existant URL. Fixed in extractXCFrameworks() by truncating the given URL down to its extant portion. Since we only care about prefix matching, and since the Carthage/Build URL will exists at build time due to symlinkBuildPathIfNeeded, this is safe. Fixes Carthage#3122 and testing using the Cartfile in the issue.
@keithcml Did you solve this issue with RxSwift? I also have RxDataSources (but it's failing first on RxGesture).
|
which carthage
:/usr/local/bin/carthage
carthage version
:0.37.0
xcodebuild -version
:Xcode 12.4, Build version 12D4e
--no-build
? No--no-use-binaries
? Yes--use-submodules
? No--cache-builds
? Yes--new-resolver
? NoCartfile
Cartfile.resolved
The command I ran:
carthage bootstrap --platform iOS --cache-builds --no-use-binaries --use-xcframeworks
Carthage Output
The last lines of the log files:
Actual outcome
The above mentioned error.
Expected outcome
When I run
Carthage
(carthage bootstrap --platform iOS --cache-builds --no-use-binaries
) with the linker fix (orignally mentioned in #3097; not sure where that issue went), then the framework builds just fine.The linker fix:
I'm unsure if this is a bug in our framework or a bug in the latest changes.
The text was updated successfully, but these errors were encountered: