Nimble
Nimble copied to clipboard
Carthage build fails to find Nimble/Nimble-Swift.h using Xcode 11 in some environments (GitHub Actions/Xcode Bots)
- [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.
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
Seeing same issue on Jenkins CI with Xcode 11.1. Builds fine locally and on CircleCI.
Any update on this? Getting the same issue? (XCode 11.3.1. Locally it builds fine, Jenkins CI throws the error.)
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)
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?
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
We found that immediately retrying the carthage build command helps working around this issue.
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.
Hey @JosephDuffy! Really sorry about this delay. Is this still an issue you're seeing with current versions of Xcode?
@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!
Closing this as the next release of Nimble will no longer support versions of Xcode older than 13.3.