From 635156e40637d65650e91a21afec10ad8fac5c19 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Tue, 22 Dec 2020 12:56:14 -0800 Subject: [PATCH] Fix Mac tests by making an unshallow copy of Homebrew repos It seems that updating shallow Git clones is expensive, and as a result Homebrew recently started refusing to update shallow clones (see https://github.com/Homebrew/discussions/discussions/226). This commit tries to fix the problem by making these repos into full clones before running "brew update". I also came across another error about there being a conflicting version of pip3 in /usr/local. I suspect that is related to the other Python binaries that the script has to delete, so I added pip3 to the list and that seemed to solve the problem. --- kokoro/macos/prepare_build_macos_rc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kokoro/macos/prepare_build_macos_rc b/kokoro/macos/prepare_build_macos_rc index 830e7eee6731..d1154e3f5cf9 100755 --- a/kokoro/macos/prepare_build_macos_rc +++ b/kokoro/macos/prepare_build_macos_rc @@ -37,10 +37,14 @@ sudo rm -rf \ sudo rm -rf \ /usr/local/bin/2to3* \ /usr/local/bin/idle3* \ + /usr/local/bin/pip3 \ /usr/local/bin/pydoc3* \ /usr/local/bin/python3* \ /usr/local/bin/pyvenv* +git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow +git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow + brew update brew upgrade