google / EarlGrey

:tea: iOS UI Automation Test Framework
http://google.github.io/EarlGrey/
Apache License 2.0
5.62k stars 744 forks source link

Building EarlGrey through carthage with xcode10 fails #732

Open RtgrV opened 6 years ago

RtgrV commented 6 years ago

Hello all,

When we build EarlGrey through carthage on our CI, with the newest xcode 10 beta, it fails to compile. Is anyone looking into these problems?

Exit status of command 'carthage build --platform iOS --derived-data /Users/.../workspace/iOS-Integration_xcode-10-FKPXLIXHF2LZNBLEHI2A3UF7JBJ4MLJB6OW6QZ5JJOQNF722BLWA/XcodeDerivedData --cache-builds' was 1 instead of 0.
*** No cache found for EarlGrey, building with all downstream dependencies
//// Other frameworks
*** Building scheme "EarlGrey" in EarlGrey.xcodeproj
Build Failed
    Task failed with exit code 65:
    /usr/bin/xcrun xcodebuild -project /Users/..../workspace/iOS-Integration_xcode-10-FKPXLIXHF2LZNBLEHI2A3UF7JBJ4MLJB6OW6QZ5JJOQNF722BLWA/.../Carthage/Checkouts/EarlGrey/EarlGrey.xcodeproj -scheme EarlGrey -configuration Release -derivedDataPath /Users/.../workspace/iOS-Integration_xcode-10-FKPXLIXHF2LZNBLEHI2A3UF7JBJ4MLJB6OW6QZ5JJOQNF722BLWA/XcodeDerivedData/10.0_10L201y/EarlGrey/1.14.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/yc/tjq3l5k126158h1f_8hfsn5r0000gn/T/EarlGrey SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/..../workspace/iOS-Integration_xcode-10-FKPXLIXHF2LZNBLEHI2A3UF7JBJ4MLJB6OW6QZ5JJOQNF722BLWA/.../Carthage/Checkouts/EarlGrey)

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

Used Setup

Cartfile.private

github "google/EarlGrey"

Cartfile.resolved

github "google/EarlGrey" "1.14.0"

Carthage command

carthage bootstrap --cache-builds --platform iOS

Terminal settings

Set xcode-select to xcode-beta.app.

Thanks in advance :-) .

RtgrV commented 6 years ago

Building from xcode-10 is fine, building with carthage goes wrong.

The log file, /var/folders/yc/tjq3l5k126158h1f_8hfsn5r0000gn/T/carthage-xcodebuild.Jr5TTv.log gives the following output:

error: Build input file cannot be found: '/Users/<user>/<project>/Carthage/Checkouts/EarlGrey/fishhook/fishhook.c'

** ARCHIVE FAILED **
RtgrV commented 6 years ago

Carthage run is going good after the second run. To reproduce the issue, remove EarlGrey from the Carthage folder. But well, it should go fine in the first run?

jeanherfs commented 6 years ago

We are also experiencing this issue, is there any plan to fix it? It will be required before the launch of iOS 12.

RtgrV commented 6 years ago

Still having this issue with the new EarlGrey 1.15.0 .

badrinathvm commented 6 years ago

I am also seeing the issue on build machines only.

Compiling fishhook.c 17:37:42 17:37:42 ❌ error: Build input file cannot be found:

Any fix available ?

tirodkar commented 6 years ago

It looks like the pre-rec files aren't being downloaded with the new build system. @RtgrV - what was the change to get it working the second time?

badrinathvm commented 6 years ago

I fixed it by creating EarlGrey.framework and include it as part of Embedded Binaries field, it works

tirodkar commented 6 years ago

Thanks @badrinathvm. @RtgrV Anyway that could help you with the Carthage issues?

RtgrV commented 6 years ago

@tirodkar no change needed. Removing all files -) run -) fails -) run again -) succeeds 100% reproducible

At our project we did the same thing as @badrinathvm . But I believe this is a work around and not an actual fix..

badrinathvm commented 6 years ago

@RtgrV Yes, this is a alternative way i say. Because Xcode 10 doesn't allow to download the files while compiling , everything should be done prior. By doing this we might miss out the new features which may be added to Earl Grey framework. May be Earl Grey should find a way to download them before.

tirodkar commented 6 years ago

We just use a simple script to download the files. These are pre-requisites to get EarlGrey to compile, so we can't have files as part of EarlGrey do the downloading itself.

yoon-boom commented 6 years ago

If you are manually pulling (EarlGrey 1.15.0) source code into your project and running CI with X Code 10,

  1. Have a fishhook directory ready from previous 1.14.0
  2. Edit .gitignore file on EarlGrey directory using text editor comment out #fishhook
  3. git add/commit/push update your repo

above step resolve my issue. It looks like X Code 10 restricts running or downloading dependency (fishhook) by its script from other project target like @tirodkar mentioned.

SteffenL commented 5 years ago

This sounds like a problem I was just struggling with in my own project, mainly Xcode being unable to see new files that were downloaded and compiled using an external build system during a script phase. I just wanted to make a wrapper around a third party library that allowed it to be used with Carthage. Xcode failed to find the compiled library despite it existing on the file system.

I was able to solve this by specifying the files I cared about under the "Output Files" section of the script phase. That made Xcode realize that those files were added or changed.

Maybe this can help you somehow.