Xcode >=10.2 requires macOS >=10.14.4 to build many formulae

build-env
homebrew
mac
#1

Travis has suddenly failed on “brew install sourcery” command.

This is a build that we had on Xcode 10.2 image and everything worked fine and nothing was changed in travis.yml. On the next day when I’ve added some changes in our project our build suddenly errors with Homebrew issue.

I assume that there is something with that image, because right the same image worked a day before. For about a day I’ve tried to rerun that build and it still crashed with that issue.

Build with error.
https://travis-ci.com/VerizonAdPlatforms/VerizonVideoPartnerSDK-iOS/builds/107828894
Successful build where everything worked (except Unit tests).
https://travis-ci.com/VerizonAdPlatforms/VerizonVideoPartnerSDK-iOS/builds/107437791

#2

After some investigation the build was started successfully after we’ve removed brew update command from yml. But I’m still wondering: why it caused an issue at all?

#3

Summary:

  • brew update-reset was indeed the culprit
  • You should expect your builds to break again soon. This may or may not be a bug depending on whether sourcery really requires XCode to run and whether XCode 10.2 really requires MacOS 10.14.4.

When diffing the logs, you can see these interesting changes:

 ==> Fetching /usr/local/Homebrew...
 
 From https://github.com/Homebrew/brew
 
-   cf4511f72..0f09deded  master     -> origin/master
+   cf4511f72..1c655916f  master     -> origin/master
 
<...>  
@@ -621,7 +621,7 @@
 
 From https://github.com/Homebrew/homebrew-core
 
-   33a5454..6ad4351  master     -> origin/master
+   33a5454..db13fbb  master     -> origin/master

For homebrew-core, there are no changes for sourcery.rb between those revisions. But the formula includes this chunk:

  depends_on :xcode => ["10.0", :build]
  depends_on :xcode => "6.0"

But for brew, there are these relevant commits:

(The 1st one is actually before the 1st build, but it had no effect until the 2nd one fixed a bug in it.)

So, with Homebrew HEAD and the current formula code, sourcery will fail to install with xcode: 10.2 in MacOS<10.14.4.

Now, why did it start working despite the auto-update when you removed brew update-reset?

That’s because, as it turns out, autoupdate only updates to the latest tag rather than HEAD while update-reset updates to HEAD. And this change isn’t yet in tag.

Looking at the tag history, they are made approximately every 1-2 weeks. And the latest one was on 04.04.2019.

#4

@BanzaiMan Looks like you need to bump your xcode: 10.2 images to MacOS 10.14.4 or negotiate with the Homebrew team about their hard requirement of 10.14.4 for XCode 10.2. Otherwise, heads are gonna roll builds are gonna fail.