git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] ci: don't update Homebrew

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Jul 3, 2019, 10:47 UTC
Message-ID
<20190703104748.32533-1-szeder.dev@gmail.com>
In-Reply-To
<20190629170108.GF21574@szeder.dev>

Lately our GCC macOS build job on Travis CI has been erroring out while installing dependencies with:

  +brew link gcc@8
  Error: No such keg: /usr/local/Cellar/gcc@8
  The command "ci/install-dependencies.sh" failed and exited with 1 during .

Now, while gcc@8 is still pre-installed (but not linked) and would be perfectly usable in the Travis CI macOS image we use [1], it's at version 8.2. However, when installing dependencies we first explicitly run 'brew update', which spends over two minutes to update itself and information about the available packages, and it learns about GCC 8.3. After that point gcc@8 exclusively refers to v8.3, and, unfortunately, 'brew' is just too dumb to be able to do anything with the still installed 8.2 package, and the subsequent 'brew link gcc@8' fails. (Even 'brew uninstall gcc@8' fails with the same error!)

Don't run 'brew update' to keep the already installed GCC 8.2 'brew link'-able. Note that in addition we have to 'export HOMEBREW_NO_AUTO_UPDATE=1' first, because 'brew' is so very helpful that it would implicitly run update for us on the next 'brew install <pkg>' otherwise.

Disabling 'brew update' has additional benefits:
  - It shaves off 2-3mins from the ~4mins currently spent on
    installing dependencies, and the macOS build jobs have always been
    prone to exceeding the time limit on Travis CI.
  - Our builds won't suddenly break because of the occasional Homebrew
    breakages [2].

The drawback is that we'll be stuck with slightly older versions of the packages that we install via Homebrew (Git-LFS 2.5.2 and Perforce 2018.1; they are currently at 2.7.2 and 2019.1, respectively). We might want to reconsider this decision as time goes on and/or switch to a more recent macOS image as they become available.

[1] 2000ac9fbf (travis-ci: switch to Xcode 10.1 macOS image,
    2019-01-17)
[2] See e.g. a1ccaedd62 (travis-ci: make the OSX build jobs' 'brew
    update' more quiet, 2019-02-02) or
    https://public-inbox.org/git/20180907032002.23366-1-szeder.dev@gmail.com/T/#+u
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
 ci/install-dependencies.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index 7f6acdd803..7f546c8552 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -34,7 +34,7 @@ linux-clang|linux-gcc)
 	popd
 	;;
 osx-clang|osx-gcc)
-	brew update >/dev/null
+	export HOMEBREW_NO_AUTO_UPDATE=1
 	# Uncomment this if you want to run perf tests:
 	# brew install gnu-time
 	test -z "$BREW_INSTALL_PACKAGES" ||
-- 
2.22.0.621.ge52941b842.dirty
Previous: SZEDER GáborNext: SZEDER Gábor
Message 8 of 18 in “Travis not looking so good”
  1. Johannes SchindelinMay 30, 2019
  2. brian m. carlsonJun 1, 2019
  3. SZEDER GáborJun 2, 2019
  4. Taylor BlauJun 26, 2019
  5. SZEDER GáborJun 27, 2019
  6. Junio C HamanoJun 27, 2019
  7. SZEDER GáborJun 29, 2019
  8. 1/2 ci: don't update HomebrewSZEDER Gábor, Jul 3, 2019
  9. 2/2 ci: disable Homebrew's auto cleanupSZEDER Gábor, Jul 3, 2019
  10. Johannes SchindelinJul 3, 2019
  11. Thomas BraunJul 3, 2019
  12. SZEDER GáborJul 3, 2019
  13. Junio C HamanoJul 3, 2019
  14. ci/lib.sh: update a comment about installed P4 and Git-LFS versionsSZEDER Gábor, Jul 6, 2019
  15. ci/lib.sh: update a comment about installed P4 and Git-LFS versionsSZEDER Gábor, Jul 6, 2019
  16. Johannes SchindelinJul 8, 2019
  17. Taylor BlauJul 9, 2019
  18. Junio C HamanoJul 10, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.