New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xcodebuild time out while trying to read ____ (on Travis…) #1310

Closed
schwa opened this Issue May 17, 2016 · 30 comments

Comments

Projects
None yet
@schwa

schwa commented May 17, 2016

Xcode 7.3.1, Carthage 0.16.2.

We have a carthage project running on Travis CI and it has started timing out (throwing XcodebuildTimeout errors) inside xcodebuild tasks.

xcodebuild timed out while trying to read Rx.xcworkspace 😭

I found two xcodebuild tasks that throw these errors and the timeout and retry values are inconsistent (see https://github.com/Carthage/Carthage/search?q=XcodebuildTimeout ). I suggest standardising on a 60 second timeout with 2 retries (as per Xcode.swift / schemesInProject).

I also suggest that carthage log the exact tool output so the user can see exactly what is failing and therefore provide better feedback to Carthage team.

I've implemented the latter two suggestions in this fork: https://github.com/schwa/Carthage/tree/jwight/timeout_tests - that I'm currently testing.

It might also be handy to expose a timeout parameter to carthage (possibly via an environment variable) so users can workout timeout problems without waiting for a new carthage release? (Not implemented on my branch yet - not sure environ variable is correct solution).

@mdiep

This comment has been minimized.

Member

mdiep commented May 18, 2016

Could you test how long it takes to read those files on Travis? I'd be happy to adjust the timeout based on timings on Travis.

This is a tricky item because sometimes xcodebuild will work immediately on the second attempt. That's why the timeout is shorter for this particular case. Adding a longer timeout will increase the build times for some users, so I don't want to make the timeout longer than necessary.

We could also do something akin to an exponential back off to get a quick retry but prevent timeouts for larger projects. That would require more work, but is ultimately the best solution. Pull requests welcome for that. 😄

@Hais

This comment has been minimized.

Hais commented Jul 1, 2016

I'm currently battling with TravisCI now to try and get to the bottom of this. With an open ticket with Travis support to see if they can help track the issue where applicable.

Is there any kind of data I can collect for yourselves to help determine the problem?

Mines a fairly large project with 25+ Carthage dependancies. But it consistently fails with the same timeout after on the same dependancy each time. If I remove the failing dependancy it then fails on the next one. etc.

@mdiep

This comment has been minimized.

Member

mdiep commented Jul 2, 2016

This is a bug in the xcodebuild command line program provided by Xcode. We try to work around it by adding a timeout. That timeout can be too short on slow hardware like Travis.

It'd be helpful to know (a) which xcodebuild command is timing out and (b) how long it takes to run that command successfully. Then we can adjust the timeout.

@schwa

This comment has been minimized.

schwa commented Jul 6, 2016

Out of curiosity - what's the evidence that this is an actual bug in xcodebuild? We've run various tests (including replacing carthage with our own python based alternative: http://github.com/schwa/punic) and xcodebuild info/showBuildSettings have been 100% reliable - both locally and on travis (with their painfully slow VMs). I'm more inclined to believe the issue is with RACTask. Has that been ruled out yet?

@mdiep

This comment has been minimized.

Member

mdiep commented Jul 6, 2016

I've reproduced the hangs with xcodebuild directly on my machine.

@samsonjs

This comment has been minimized.

samsonjs commented Aug 27, 2016

I'm trying to run carthage bootstrap on a 2016 MacBook and with Carthage 0.17.2 it fails consistently with xcodebuild timed out while trying to read CoreDataLogger.xcodeproj 😭. Tried that several times with no luck.

So I found all these issues about timeouts, cloned the Carthage repo, changed the timeouts for xcodebuild -list and xcodebuild -showBuildSettings to 24 hours, and now it works. At least one of these timeouts is still too low for real world use for me. I can experiment a bit to try and find a better middle ground between 30s and 24h.

edit: Upping the build settings timeout to 60 seconds seems to be enough for bootstrap to work reliably on this machine.

@yas375

This comment has been minimized.

Contributor

yas375 commented Aug 31, 2016

I'm getting the same error when running integration tests for a library on TravisCI:

Works fine locally (carthage 0.17.2)

@Mehdzor

This comment has been minimized.

Mehdzor commented Aug 31, 2016

+1

@Mehdzor

This comment has been minimized.

Mehdzor commented Aug 31, 2016

@samsonjs, how did you set timeouts?

yas375 added a commit to mattt/FormatterKit that referenced this issue Sep 1, 2016

@yas375

This comment has been minimized.

Contributor

yas375 commented Sep 1, 2016

I'm not sure if it would help but just in case:

I have integration tests for a framework. The framework has multiple languages. One of the recent changes I did for the framework after which tests have started to fail, is that I moved all localizations into a bundle. Not sure if this is the reason why it times out, but just in case...

UPD: I'm wrong. I had incorrect exit codes in my integration tests. It was failing for a while with these timeouts.

@samsonjs

This comment has been minimized.

samsonjs commented Sep 1, 2016

yas375 added a commit to mattt/FormatterKit that referenced this issue Sep 10, 2016

Don't run integration tests with Carthage on CI
Turns out they were always timing out on Travis:
https://travis-ci.org/mattt/FormatterKit/builds/132039819#L2817

Disabling integration tests until
Carthage/Carthage#1310 gets resolved.
@gbejarano01

This comment has been minimized.

gbejarano01 commented Sep 12, 2016

+1 Experiencing the same issue here.

@frogcjn

This comment has been minimized.

frogcjn commented Oct 3, 2016

@samsonjs, how did you set timeouts??

@samsonjs

This comment has been minimized.

samsonjs commented Oct 3, 2016

@frogcjn samsonjs@946e202 ... if you're using CocoaLumberjack then this will help a lot as well: samsonjs/CocoaLumberjack@ce8caa2

@frogcjn

This comment has been minimized.

frogcjn commented Oct 3, 2016

@samsonjs Thanks! I build the hacked-up branch, and it works.

@gbejarano01

This comment has been minimized.

gbejarano01 commented Oct 3, 2016

Yeah, the issue is in Xcode.swift either line 142 or 493.

Search for XcodebuildTimeout and you will find it, that's the timeout hard-coded on 60 and 30 seconds each.

@mdiep

This comment has been minimized.

Member

mdiep commented Oct 4, 2016

Are you still experiencing this issue with Carthage 0.18? We were hoping that #1447 would work around this issue.

@mdiep

This comment has been minimized.

Member

mdiep commented Oct 4, 2016

Does someone want to open a PR to change the second timeout to 60 seconds for the next release?

@gbejarano01

This comment has been minimized.

gbejarano01 commented Oct 4, 2016

@mdiep is there any way to parametrize that instead? I believe that would be more appropriate, because we don't know how long it may take building one framework, it depends how big and how many dependencies it has. My two cents.

@samsonjs

This comment has been minimized.

samsonjs commented Oct 4, 2016

@mdiep My specific issues building CocoaLumberjack/CocoaLumberjack is fixed in 0.18.

@gbejarano01 Making it a parameter might be a good idea, that way people on fast machines can make it low and keep things fast and those on slow machines can configure things to actually work for them.

yas375 added a commit to yas375/Carthage that referenced this issue Oct 13, 2016

@cloutiertyler

This comment has been minimized.

cloutiertyler commented Oct 15, 2016

I am also getting this issue when trying to install the new Facebook Swift SDK.
carthage version: 0.18.1

It would be awesome to get a new release with this change merged in.

@mdiep

This comment has been minimized.

Member

mdiep commented Oct 16, 2016

No one has opened a PR to make this change. PRs welcome!

@cloutiertyler

This comment has been minimized.

cloutiertyler commented Oct 16, 2016

Are we okay with just bumping the timeout to 60 sec? Or would you prefer it be parameterized?

@yas375

This comment has been minimized.

Contributor

yas375 commented Oct 16, 2016

@mdiep @TheArtOfEngineering I've just submitted a PR with just increasing the value. I did that change a few days ago and have verified on Travis. Seem to fix the problem. I don't see much value in making it as a parameter. If it builds fast enough on your machine, then you don't need to think about it. If 60 seconds might be not enough on Travis, then I would rather increase it to even more by default.

@mdiep mdiep closed this in #1532 Oct 16, 2016

@DJBen

This comment has been minimized.

DJBen commented Dec 9, 2017

Currently I am integrating AWS SDK into iOS using Carthage and 60s doesn't seem enough for Travis.
xcodebuild timed out while trying to read AWSiOSSDKv2.xcodeproj

Would love to see this option parametrized.

@cszucko

This comment has been minimized.

cszucko commented Dec 18, 2017

I just ran into this with the AWS SDK as well. This was on a 1.8 GHz i7 mid-2011 MacBook Air, so it needing extra time isn't a huge shock.

I was able to get around the issue by building my own version of Carthage with the timeout raised to to 240 seconds (see: BuildSettings.swift). A lower value might work too; I just picked something arbitrarily high.

@raid5

This comment has been minimized.

raid5 commented Dec 18, 2017

I'm hitting this issue as well on BuildBuddy.

xcodebuild timed out while trying to read AWSiOSSDKv2.xcodeproj

@mlfarrell-convene

This comment has been minimized.

mlfarrell-convene commented Jan 30, 2018

Exact same issue! Help!!

I'm hitting this issue as well on BuildBuddy.

xcodebuild timed out while trying to read AWSiOSSDKv2.xcodeproj

@sunchunqiang

This comment has been minimized.

sunchunqiang commented Oct 31, 2018

same issue here @mlfarrell-convene .
any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment