OSX Homebrew addons module not as reliable as claimed

If you look at the log of the build with addon, you see these lines under the section “brew”:

# Installing Homebrew Packages
$ rvm $brew_ruby do brew bundle --verbose --global
/usr/local/bin/brew tap homebrew/bundle
==> Tapping homebrew/bundle
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle'...
remote: Enumerating objects: 88, done.
remote: Counting objects: 100% (88/88), done.
remote: Compressing objects: 100% (80/80), done.
remote: Total 88 (delta 7), reused 29 (delta 4), pack-reused 0
Unpacking objects: 100% (88/88), done.
Tapped 0 formulae (183 files, 249.5KB)
Error: Your Homebrew is outdated. Please run `brew update`.
Error: Kernel.exit

So the difference between the “manual” install and the “addon” one comes from the fact that addon builds a Brewfile and executes it with brew bundle, whereas the manual install simply runs straight brew install.

The bundle command is not part of the core brew, it lives in its separate repo (see this issue which explains that it was outsourced). If you dig in their code, you find these lines:

if !defined?(HOMEBREW_VERSION) || !HOMEBREW_VERSION ||
   Version.new(HOMEBREW_VERSION) < Version.new("2.1.0")
  odie "Your Homebrew is outdated. Please run `brew update`."
end

I’m not fluent in Ruby, but it seems like they make their command error out if the Homebrew version is not high enough.

I propose to open an issue to them asking if it would be possible to warn instead of erroring out, because in our case we clearly have no control over what Homebrew version is included in the Travis macos images.

1 Like