Nimble icon indicating copy to clipboard operation
Nimble copied to clipboard

Carthage build fails to find Nimble/Nimble-Swift.h using Xcode 11 in some environments (GitHub Actions/Xcode Bots)

Open JosephDuffy opened this issue 4 years ago • 10 comments

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

What did you do?

Tried to build the Nimble project for iOS using Carthage on Xcode 11

What did you expect to happen?

Build to succeed

What actually happened instead?

The build fails with the error NMBStringify.m:6:9: fatal error: 'Nimble/Nimble-Swift.h' file not found #import <Nimble/Nimble-Swift.h>

Environment

List the software versions you're using:

  • Nimble: 8.0.4
  • Xcode Version: 11.0 (11A420a)
  • Swift Version: Xcode Default

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

  • Carthage: 0.33.0

Extra info

When trying to build Nimble via Carthage in certain environments the Nimble/Nimble-Swift.h file is not found. I found that it fails in GitHub actions (example), but a question on StackOverflow shows it is failing when built by an Xcode Bot.

In GitHub actions is only fails when using Xcode 11, but for Xcode Bots I'm not sure (the question does not specify).

Workaround

The project can be built when using the Debug configuration, but this is not ideal.

JosephDuffy avatar Oct 01 '19 17:10 JosephDuffy

Also getting this issue after update to MacOS Catalina 10.15 when using Carthage Running command manually on terminal: carthage update --no-use-binaries --platform iOS

• Nimble: 8.0.4 • Xcode Version: 11.0 (11A420a) • Swift Version: Xcode Default (5.1)

It would be nice to get a fix, it's breaking our builds

elefantel avatar Oct 09 '19 08:10 elefantel

Seeing same issue on Jenkins CI with Xcode 11.1. Builds fine locally and on CircleCI.

vlypskyi avatar Nov 11 '19 15:11 vlypskyi

Any update on this? Getting the same issue? (XCode 11.3.1. Locally it builds fine, Jenkins CI throws the error.)

Danesz avatar Feb 25 '20 08:02 Danesz

If anyone is still seeing this issue when using GitHub Actions, I managed to get it to work by patching Nimble to use the legacy build system (setting BuildSystemType to Original in its WorkspaceSettings.xcsettings file)

dflems avatar Mar 09 '20 21:03 dflems

This is happening for me also. I tried both the workaround in https://github.com/Quick/Nimble/issues/702#issuecomment-596795483 and in https://github.com/Quick/Nimble/issues/702#issue-501042531. However, the github action keeps failing (but it works locally, interestingly enough).

The error I see in the logs is:

2020-04-11T08:26:47.2034330Z /Users/runner/runners/2.168.0/work/App-iOS/App-iOS/Pods/Nimble/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/include/CwlPreconditionTesting.h:32:10: error: 'CwlCatchException.h' file not found
2020-04-11T08:26:47.2034440Z         #import "CwlCatchException.h"
2020-04-11T08:26:47.2034520Z                 ^
2020-04-11T08:26:47.2034920Z <unknown>:0: error: could not build Objective-C module 'Nimble'

I am using Cocoapods too pull in Nimble. My podfile: https://gist.github.com/skywalkerdude/a77b51431472668a577a9ddfa125b18a

Does anyone know how to fix or get around this?

skywalkerdude avatar Apr 11 '20 08:04 skywalkerdude

I'm struggling with this as well. Builds perfectly fine locally using Xcode 11.3.1 (and Xcode 11.4) but fails on CI most of the times. Suddenly couple of builds succeeded yesterday on CI, but then it started to fail again. And I'm always doing a clean install on CI with all Carthage caches cleared so the install should be deterministic.

According to the Xcode build logs on CI, the automatically generated Objective-C header Nimble-Swift.h is created correctly during the build process. Still it fails with: Carthage/Checkouts/Nimble/Sources/NimbleObjectiveC/NMBStringify.m:6:9: fatal error: 'Nimble/Nimble-Swift.h' file not found

mikkoseppa avatar Apr 14 '20 11:04 mikkoseppa

We found that immediately retrying the carthage build command helps working around this issue.

vlypskyi avatar Apr 14 '20 16:04 vlypskyi

We found that immediately retrying the carthage build command helps working around this issue.

@vlypskyi Thanks for the workaround 😄 I added a try-catch block to my Fastfile where I run Carthage bootstrap, so I can re-run it.

mikkoseppa avatar Apr 16 '20 05:04 mikkoseppa

Hey @JosephDuffy! Really sorry about this delay. Is this still an issue you're seeing with current versions of Xcode?

younata avatar Apr 18 '22 23:04 younata

@younata I no longer have CI testing with Xcode 11, minimum is the latest Xcode 12 so I can't comment if this is still an issue, sorry!

JosephDuffy avatar Apr 28 '22 16:04 JosephDuffy

Closing this as the next release of Nimble will no longer support versions of Xcode older than 13.3.

younata avatar Oct 31 '22 21:10 younata