XCode 8.3 Homebrew outdated error

Starting late last night (or earlier this morning), our macOS build using the XCode 8.3 image started failing on the Homebrew install package step with the message:

Error: Your Homebrew is outdated. Please run brew update.
Error: Kernel.exit

Our last working build was June 17 @ 10:35ish pm PST: Travis CI - Test and Deploy with Confidence
And our first build seeing the error was June 18 @ 10:25ish am PST: Travis CI - Test and Deploy with Confidence

Adding update: true for updating Homebrew does resolve the error, but it significantly increases the build time by 26 minutes (6 minutes for running brew update, and installing packages takes an extra 20 minutes, probably updating a bunch of other installed packages).

3 Likes

Do you need the Xcode 8.3 image, or do you just want a 10.12 image? If the latter, the Xcode 9.2 image will work better for you.

Homebrew tends to force you (and CI) to be on the bleeding edge, and the use of older images (which are unlikely to be updated) could prove problematic.

1 Like

I’ve started getting the same error using the XCode 9.4 image (the current default macOS image, which runs macOS 10.13) on a different project, so I don’t think changing to a different image will be sufficient.

1 Like

A possible solution is to cache Homebrew metadata as per https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci.

1 Like

This error is also happening with the default image.

See: https://travis-ci.org/phpmyadmin/phpmyadmin/jobs/547831764#L141

I’m seeing this problem on the default image as well at https://travis-ci.com/certbot/certbot/builds/116169882.

I’m also seeing this problem on the default image (xcode9.4) https://travis-ci.org/ZhuangLab/storm-analysis/jobs/548885636.

FWIW, the xcode10.1 osx_image also fails. The xcode11 osx_image works. xcode10.2 untested.

10.2 worked for me a couple of days ago: https://travis-ci.org/paciofs/multichain/builds/557160831
I updated from 10.1 because it was failing as well, like you said. Wasn’t aware of 11 being out there already.

Are there are any plans to fix this issue? It seems that Homebrew is still broken in the default macOS image in Travis. See https://travis-ci.com/certbot/certbot/builds/122908542.

1 Like

Had the same issue on xcode9.4. Fixed it by just using brew install instead of the addon.

osx_image:10.2 does not seem to have the issue

This appears to have been fixed. I am no longer having this problem when I unpin my macOS image.

I’d suggest exporting the HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 environment variable to remedy the slowness with update: true. According to the manual,

If set, do not check for broken dependents after installing, upgrading or reinstalling formulae.

… which seems reasonable to use in Travis CI because a lot of packages are preinstalled for user convenience, but the typical project will only need some of them (or, even better, will explicitly list its top-level dependencies in its .travis.yml or .Brewfile).