Nimble: Fails to build --no-skip-current --platform tvOS

Created on 27 Sep 2017  路  2Comments  路  Source: Quick/Nimble

  • [x] I have read CONTRIBUTING and have done my best to follow them.

What did you do?

  • I have a framework project pact-consumer-swift:macOS with iOS, macOS and tvOS schemes.
  • Using Carthage to pull and build Quick and Nimble as dependencies.
  • Added these frameworks to the Xcode project.
  • Built and ran the unit tests in Xcode for each of the mentioned schemes. All OK, tests pass.
  • In my terminal, I ran carthage build --no-skip-current --platform tvOS.

What did you expect to happen?

Expected the schemes of all dependencies to build successfully for tvOS platform, including PactConsumerSwift tvOS.

What actually happened instead?

Build for _PactConsumerSwift tvOS_ (current) failed!

$ carthage build --no-skip-current --platform tvOS
*** xcodebuild output can be found in /var/folders/f0/pn2b1l6d1c76jhl28q79m6sc0000gn/T/carthage-xcodebuild.zYpnhj.log
*** Building scheme "Alamofire tvOS" in Alamofire.xcworkspace
*** Building scheme "Nimble-tvOS" in Nimble.xcodeproj
*** Building scheme "Quick-tvOS" in Quick.xcworkspace
*** Building scheme "Result-tvOS" in Result.xcodeproj
*** Building scheme "BrightFutures-tvOS" in BrightFutures.xcworkspace
*** Building scheme "PactConsumerSwift tvOS" in PactConsumerSwift.xcodeproj
Build Failed
    Task failed with exit code 65:
    /usr/bin/xcrun xcodebuild -project /Developer/pact-consumer-swift/PactConsumerSwift.xcodeproj -scheme PactConsumerSwift\ tvOS -configuration Release -sdk appletvos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES build (launched in /Developer/pact-consumer-swift)

The last few lines in the log:

/Developer/pact-consumer-swift/Sources/MockService.swift:60:25: error: use of undeclared type 'FileString'
  open func run(_ file: FileString? = #file, line: UInt? = #line, timeout: TimeInterval = 30,
                        ^~~~~~~~~~
/Developer/pact-consumer-swift/Sources/MockService.swift:81:50: error: use of undeclared type 'FileString'
  func failWithLocation(_ message: String, file: FileString?, line: UInt?) {
                                                 ^~~~~~~~~~
/Developer/pact-consumer-swift/Sources/MockService.swift:90:43: error: use of undeclared type 'FileString'
                                    file: FileString?,
                                          ^~~~~~~~~~
/Developer/pact-consumer-swift/Sources/MockService.swift:68:9: error: use of unresolved identifier 'fail'
        fail("Error setting up pact: \(error.localizedDescription)")
        ^~~~
/Developer/pact-consumer-swift/Sources/MockService.swift:83:7: error: use of unresolved identifier 'fail'
      fail(message, file: fileName, line: lineNumber)
      ^~~~
/Developer/pact-consumer-swift/Sources/MockService.swift:85:7: error: use of unresolved identifier 'fail'
      fail(message)
      ^~~~

** BUILD FAILED **

Environment

List the software versions you're using:

  • Quick: 1.1.0
  • Nimble: 7.0.1
  • Xcode Version: 9.0 (9A235)
  • Swift Version: 4.0 (Open Xcode Preferences; Components > Toolchains. If none, use Xcode Default.)

Please also mention which package manager you used and its version. Delete the
other package managers in this list:

  • Cocoapods: ?.?.? (Use pod --version in Terminal)
  • Carthage: ?.? (Use carthage version in Terminal)
  • Swift Package Manager ?.?.? (swiftpm-???) (Use swift build --version in Terminal)

Project that demonstrates the issue

Pact Consumer Swift

question / needs more details

All 2 comments

This is related to https://github.com/Carthage/Carthage/issues/1268 and https://github.com/Carthage/Carthage/pull/1280. You should need to add ENABLE_BITCODE=NO as a User-Defined build setting on your tvOS target. Please read that issues for the details.

Ah, right. I gave it a crack and it builds now. Thanks for pointing it out.

To elaborate on how to make it build successfully, tvOS target doesn't have ENABLE_BITCODE setting in the _Build Settings_ tab by default (iOS on the other hand does have it there already). Needed to add it manually through _Editor > Add Build Setting > Add User-Defined Setting_.

Was this page helpful?
0 / 5 - 0 ratings