$ brew upgrade
==> Upgrading 15 outdated packages:
[...snip...]
swiftlint 0.28.2 -> 0.38.1
[...snip...]
swiftlint: A full installation of Xcode.app 10.2 is required to compile
this software. Installing just the Command Line Tools is not sufficient.
Xcode 10.2 cannot be installed on macOS 10.13.
You must upgrade your version of macOS.
Error: swiftlint: An unsatisfied requirement failed this build.
I could try and fix this by brew uninstall-ing some of the preinstalled packages before updating, but that seems like a hacky/brittle way to solve this problem. Does anyone know of a better way to ensure brew upgrade works in CI?
This is a problem with the swiftlint Homebrew package. Homebrew requirements list 10.13 as still supported and since “Xcode 10.2 cannot be installed on macOS 10.13”, formulae cannot hard-require it yet. Check https://docs.brew.sh/Troubleshooting on further actions.
As a workaround, consider not running a full brew upgrade but rather only installing/upgrading the packages that you need. This will also save on build time, and upgrading packages that you don’t need is a waste anyway because the results will be lost when the build finishes.
For posterity, I ended up running brew remove swiftlint before brew update in my CI script. (I didn’t want to try and only upgrade the packages I needed because I don’t know offhand what my full dependency tree is and wasn’t sure brew install --only-dependencies would do the right thing.)
I also ended up needing to brew remove python@2 because it looks like Homebrew did another one of their upgrade-path-breaking package name shuffles (python -> python2, python3 -> python). That’s Homebrew for ya: the only constant is constant breaking changes.