Try fixing the 'brew update' issue in bootstrap script (#5400)
* Try fixing the 'brew update' issue in bootstrap script * Add a log message * Add a comment
This commit is contained in:
parent
ecf0f8c151
commit
da0b384b2a
|
@ -127,10 +127,23 @@ fi
|
||||||
|
|
||||||
# Suppress output, it's very noisy on travis-ci
|
# Suppress output, it's very noisy on travis-ci
|
||||||
echo "Refreshing Homebrew cache..."
|
echo "Refreshing Homebrew cache..."
|
||||||
if ! brew update > /dev/null; then
|
for count in {1..2}; do
|
||||||
echo "ERROR: Refreshing Homebrew cache failed..." >&2
|
# Try the update twice if the first time fails
|
||||||
exit 2
|
brew update > /dev/null && break
|
||||||
fi
|
|
||||||
|
# If the update fails again after increasing the Git buffer size, exit with error.
|
||||||
|
if [[ $count == 2 ]]; then
|
||||||
|
echo "ERROR: Refreshing Homebrew cache failed..." >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# The update failed for the first try. An error we see a lot in our CI is "RPC failed; curl 56 SSLRead() return error -36".
|
||||||
|
# What 'brew update' does is to fetch the newest version of Homebrew from GitHub using git, and the error comes from git.
|
||||||
|
# A potential solution is to increase the Git buffer size to a larger number, say 150 mb. The default buffer size is 1 mb.
|
||||||
|
echo "First attempt of update failed. Increase Git buffer size and try again ..."
|
||||||
|
git config --global http.postBuffer 157286400
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
# Suppress output, it's very noisy on travis-ci
|
# Suppress output, it's very noisy on travis-ci
|
||||||
if [[ ! -d $(brew --prefix cask) ]]; then
|
if [[ ! -d $(brew --prefix cask) ]]; then
|
||||||
|
|
Loading…
Reference in a new issue