Carthage: Xcode 8 (b3) + Swift 2.3: Carthage build fails but normal build works.

Created on 20 Jul 2016  Â·  15Comments  Â·  Source: Carthage/Carthage

  • carthage version: 0.17.2
  • xcodebuild -version: Xcode 8.0 // Build version 8S162m (but TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 to build using Swift 2.3)
  • Are you using --no-build? No
  • Are you using --no-use-binaries? No
  • Are you using --use-submodules? No

Cartfile

github "Alamofire/Alamofire" "swift2.3"
github "Alamofire/AlamofireNetworkActivityIndicator" "swift2.3"
github "duemunk/Async"
github "xmartlabs/Eureka" "swift2.3"
github "Haneke/HanekeSwift"
github "JonasGessner/JGProgressHUD"
github "mixpanel/mixpanel-iphone"
github "mac-cain13/R.swift.Library"
github "malcommac/SwiftDate"
github "SwiftyBeaver/SwiftyBeaver"
github "SwiftyJSON/SwiftyJSON"

I don't understand why I can build the framework with Xcode if I open the project but I can't do it using Carthage. The code is correct if I open it in Xcode. Is that related to Eureka framework? I opened an issue but apparently it's maybe due to Carthage?

One developer suggests

When compiling Source/Helpers.swift in Xcode you will see that this builds correctly.
Seems that Carthage is using another version of Swift compiler. I do not know how to change this but you must make sure that you are using the compiler from Xcode 8 beta 2.

Carthage Output

AxeleFounders3:Skipper Axel$ TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 carthage update --platform iOS

*** xcodebuild output can be found in /var/folders/01/z3cm_qz957d4jwx6f54_f6pr0000gn/T/carthage-xcodebuild.AWR8hW.log
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
*** Building scheme "AlamofireNetworkActivityIndicator" in AlamofireNetworkActivityIndicator.xcodeproj
*** Building scheme "Pods-AsyncExample iOS-AsyncSwift" in AsyncPodsExample.xcworkspace
*** Building scheme "Async iOS" in Async.xcodeproj
*** Building scheme "Eureka" in Eureka.xcworkspace
--- xcodebuild: WARNING: Unable to open project file '/Users/Axel/Developer/Skipper/Carthage/Checkouts/Eureka/Eureka.playground' in workspace '/Users/Axel/Developer/Skipper/Carthage/Checkouts/Eureka/Eureka.xcworkspace'.
** BUILD FAILED **


The following build commands failed:
    CompileSwift normal arm64
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
A shell task (/usr/bin/xcrun xcodebuild -workspace /Users/Axel/Developer/Skipper/Carthage/Checkouts/Eureka/Eureka.xcworkspace -scheme Eureka -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
--- xcodebuild: WARNING: Unable to open project file '/Users/Axel/Developer/Skipper/Carthage/Checkouts/Eureka/Eureka.playground' in workspace '/Users/Axel/Developer/Skipper/Carthage/Checkouts/Eureka/Eureka.xcworkspace'.
** BUILD FAILED **


The following build commands failed:
    CompileSwift normal arm64
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)

Thanks,
Axel

question

Most helpful comment

1447 was merged and released as 0.18. So the hang should not happen anymore.

All 15 comments

It seems that it is connected with the following issue: https://forums.developer.apple.com/thread/52139

If I jump right into the container of the simulator, I clearly can see that a lot of swift framework files are missing. If I create an example project with Xcode, it works and also the swift framework files are present.

I tested the swift2.3 branch of Eureka with Xcode 8 beta 3, but I can't build the project within Xcode, without using Carthage. So looks like this is not related to Carthage itself, right?

2016-07-20 22 55 22

I don't know if this is related but I am having a problem trying to build CocoaLumberjack with Carthage and XCode 8. I've submitted https://github.com/CocoaLumberjack/CocoaLumberjack/issues/755 but I think this might be a Carthage issue. CocoaLumberjack builds correctly if I use xcodebuild directly.

Using the XCode 7.3.1 toolchain I get the following output:

➜  CocoaLumberjack git:(ed86d69) xcodebuild -version
Xcode 7.3.1
Build version 7D1014
➜  CocoaLumberjack git:(ed86d69) carthage build --no-skip-current --platform ios
*** xcodebuild output can be found in /var/folders/gf/dslbq4t94zg44sz7wnk2lg2r0000gp/T/carthage-xcodebuild.GoJy54.log
*** Building scheme "CocoaLumberjack" in Lumberjack.xcworkspace
*** Building scheme "CocoaLumberjackSwift" in Lumberjack.xcworkspace
*** Building scheme "CocoaLumberjackSwift-iOS" in Lumberjack.xcworkspace
*** Building scheme "CocoaLumberjack-iOS" in Lumberjack.xcworkspace

Using the XCode 8.0 toolchain (Swift 2.3) I get the following output:

➜  CocoaLumberjack git:(ed86d69) xcodebuild -version                            
Xcode 8.0
Build version 8S174q
➜  CocoaLumberjack git:(ed86d69) TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 carthage build --no-skip-current --platform ios
*** xcodebuild output can be found in /var/folders/gf/dslbq4t94zg44sz7wnk2lg2r0000gp/T/carthage-xcodebuild.YilbB2.log
xcodebuild timed out while trying to read CoreDataLogger.xcodeproj 

Also the xcodebuild output file was empty.

Judging by the console output my guest is that for some reason Carthage is picking up some workspace file which it shouldn't use because the project's root directory only contains a Lumberjack.xcodeproj. For some reason this use to work with XCode 7.3.1 but not with XCode 8.0 because CoreDataLogger.xcodeproj seems to be a Demo project and shouldn't be built when building the framework.

xcodebuild timed out while trying to read CoreDataLogger.xcodeproj

That's an Xcode issue that we can't really work around. 😕

Are you sure is an Xcode issue. I mean obviously is xcodebuild the one that timed out but if I do

TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 xcodebuild -project Lumberjack.xcodeproj -scheme CocoaLumberjack-iOS build && TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 xcodebuild -project Lumberjack.xcodeproj -scheme CocoaLumberjackSwift-iOS build

The project compiles. What is carthage build doing apart from what the command above does?

xcodebuild -project Demos/CoreDataLogger/CoreDataLogger.xcodeproj -showBuildSettings success with Xcode 7.3.1 but hangs with Xcode 8. So this would be an Xcode issue. Closing.

What is carthage build doing apart from what the command above does?

Carthage collects all the shared dynamic framework schemes of all the *.xcodeprojs or *.xcworkspaces in the repository.

@ikesyo Thanks for the explanation! I will file a radar and hope this gets fixed in the new beta. In the mean (probably for different thread), shouldn't carthage provide a way to specify the project/workspace from which to collect the shared frameworks schemes?

Re: "xcodebuild -showBuildSettings"

I have some additional info about what seems to trigger this (but no workaround):
https://forums.developer.apple.com/message/153599

I'm having the same issue with Xcode 8 GM Seed

xcodebuild timed out while trying to read CoreDataLogger.xcodeproj �
________________________________________________________________________________
| => xcodebuild -version
Xcode 8.0
Build version 8A218a
____________________

no workaround yet. :-(

That issue will hopefully be fixed in the next Carthage release sometime this weekend.

Thanks for the update. Let me know if I can help?

For me this worked: xcodebuild clean -showBuildSettings

I'll give that a try today. I thought I ran that once, but I tried so many things who knows. I'll post the results.

1447 was merged and released as 0.18. So the hang should not happen anymore.

I can confirm that 0.18 fixed the hanging error for me. Thanks guys for the hard work!

Was this page helpful?
0 / 5 - 0 ratings