mattgallagher / CwlSignal

A Swift framework for reactive programming.
ISC License
304 stars 33 forks source link

Installation through Carthage fails citing Bitcode issues #13

Closed zoul closed 7 years ago

zoul commented 7 years ago

Trying to install 2.0.0-beta.8 through Carthage with Xcode 8.3.3:

ld: bitcode bundle could not be generated because '/Users/zoul/Library/Caches/org.carthage.CarthageKit/DerivedData/CwlSignal/2.0.0-beta.8/Build/Products/Release-iphoneos/CwlUtils.framework/CwlUtils' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Am I doing something wrong? I tried 1.x, but that also fails to install through Carthage for a different reason.

mattgallagher commented 7 years ago

CwlSignal has never built properly using Carthage. It is something that I will address as part of the tidy up for CwlSignal 2.0 – some time this week, I hope.

Specifically, your problem occurs because the child CwlUtils project is pulled automatically by CwlSignal (which uses the Swift Package Manager internally as part of the "FetchDependencies" target) and the pulled project is built using xcodebuild (in the "CwlUtils" target). This child CwlUtils project is not using the same parameters that the parent CwlSignal uses and this is causing a conflict.

There are two issues here:

I will address during the version 2 beta phase and make testing with Carthage a standard part of my build testing.

zoul commented 7 years ago

Great explanation, thank you! If someone stumbles into this issue in the meantime, a temporary workaround is to add the CwlUtils Xcode project from the Carthage Checkout folder into the Xcode workspace with the app and build against that.

zoul commented 7 years ago

FWIW, 2.0.0-beta.13 now builds for me using Carthage. Didn’t try the betas in between.

mattgallagher commented 7 years ago

Yes, the fixes should be in CwlSignal beta 10 and CwlUtils beta 6 and onwards. I'm leaving the two issues open at the moment while I complete some tidy ups and testing but it should work in most cases.

mattgallagher commented 7 years ago

And then I clicked the "Close and comment" button instead of the "Comment" button. Whoops.

mattgallagher commented 7 years ago

Okay, I implemented my planned target restructuring in CwlSignal 2.0.0-beta.18 and it looks like Carthage is still building correctly. It looks like the solution here is stable so I'm going to close this now.