From d9396a56da13df97827e193f636a7593fb4d7864 Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Fri, 4 Feb 2022 10:44:50 +0100 Subject: [PATCH] ci: Attempt to make macOS builds more reliable The macOS CI tasks often error fail when doing `brew update` with git fetch errors: ``` remote: fatal: packfile /data/repositories/b/nw/b6/07/5c/123272362/network.git/objects/pack/pack-2139bd07361b62a358e380a0e7d58ec35593d191.pack cannot be accessed fatal: protocol error: bad pack header Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed! ``` Superficially this seems to be a problem on the GitHub server because the message shows a "remote" error. But it seems we're the only one in the world running into this specific issue when doing `brew update`, so it's more likely that the something else is the culprit, and this error message is just a symptom. This commit replaces `brew update` with a complete reinstallation of brew. This is essentially a shot in the dark but it's worth a try, and I doubt it's significantly more expensive. If that won't work, we may consider simply retrying `brew update` a few times. --- .cirrus.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index ffbd820710..6998119544 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -135,7 +135,9 @@ task: ## - rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress ## brew_valgrind_pre_script: - - brew update + # Reinstall brew. We could do `brew update` instead but that often fails. + - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" + - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - brew config - brew tap LouisBrunner/valgrind # Fetch valgrind source but don't build it yet.