Error building Alamofire and Texture in same Cartfile using Xcode 10.1 + Carthage

Viewed 251

I have an iOS project that uses both Alamofire and Texture. I haven't been able to build both at the same time using Carthage and Xcode 10.1.

  • With carthage update --platform ios, Alamofire fails with "thread-local storage is not supported for the current target"
  • With @Saik0s workaround script, Alamofire fails with no message at all (log below)

Has anyone else had success with Carthage, Alamofire, and Xcode 10.1?

Empty project exhibiting the failure is at github/kenstir/swift-samples/SadCarthage

Carthage Output

macken:SadCarthage kenstir$ ./carthage-update 
*** Cloning Alamofire
*** Cloning texture
*** Cloning PINCache
*** Cloning PINRemoteImage
*** Cloning PINOperation
*** Cloning libwebp
*** Checking out Alamofire at "4.7.3"
*** Checking out PINCache at "3.0.1-beta.6"
*** Checking out texture at "2.7"
*** Checking out PINRemoteImage at "3.0.0-beta.13"
*** Checking out PINOperation at "1.1.1"
*** Checking out libwebp at "v0.6.0"
*** Downloading PINOperation.framework binary at "Just fixing some warnings"
*** Downloading PINCache.framework binary at "3.0.1-beta.6"
*** Downloading PINRemoteImage.framework binary at "3.0 beta 13: Animated WebP support / better GIF handling"
*** xcodebuild output can be found in /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/carthage-xcodebuild.H7FuEl.log
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
Build Failed
    Task failed with exit code 4:
    /usr/bin/xcrun xcodebuild -workspace /Users/kenstir/Documents/xcode/swift-samples/SadCarthage/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace -scheme Alamofire\ iOS -configuration Release -derivedDataPath /Users/kenstir/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/Alamofire/4.7.3 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/Alamofire SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/kenstir/Documents/xcode/swift-samples/SadCarthage/Carthage/Checkouts/Alamofire)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/carthage-xcodebuild.H7FuEl.log

xcodebuild log

macken:SadCarthage kenstir$ cat /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/carthage-xcodebuild.H7FuEl.log
/usr/bin/xcrun xcodebuild -workspace /Users/kenstir/Documents/xcode/swift-samples/SadCarthage/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace -scheme Alamofire\ iOS -configuration Release -derivedDataPath /Users/kenstir/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/Alamofire/4.7.3 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/Alamofire SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/kenstir/Documents/xcode/swift-samples/SadCarthage/Carthage/Checkouts/Alamofire)User defaults from command line:
    IDEArchivePathOverride = /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/Alamofire
    IDEDerivedDataPathOverride = /Users/kenstir/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/Alamofire/4.7.3

Build settings from command line:
    CARTHAGE = YES
    CLANG_ENABLE_CODE_COVERAGE = NO
    CODE_SIGN_IDENTITY = 
    CODE_SIGNING_REQUIRED = NO
    GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphoneos12.1
    SKIP_INSTALL = YES
    STRIP_INSTALLED_PRODUCT = NO

Build settings from configuration file '/tmp/static.xcconfig.30m4Ve':
    ONLY_ACTIVE_ARCH = 

Update

I took a clue from the above message ONLY_ACTIVE_ARCH = (empty), so I edited the carthage-update script like so:

--- SadCarthage/carthage-update
+++ SadCarthage/carthage-update
@@ -8,7 +8,8 @@ IFS=$'\n\t'

 xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
 trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
-echo "ONLY_ACTIVE_ARCH[sdk=iphonesimulator*] = YES" >>$xcconfig
+echo "ONLY_ACTIVE_ARCH = YES" >>$xcconfig
 export XCODE_XCCONFIG_FILE="$xcconfig"

+cat $xcconfig
 carthage update --platform ios $@

Now it builds! I'm not convinced this is the final answer but it's working so far for me.

0 Answers
Related