fix: don't run scripts/fetch-brew-bottle.sh in parallel
It's not supported to run `brew update` multiple times simultaenously. A better fix for this can be implemented, but for now in the Makefile have target `bottles/pcre` depend on target `bottles/openssl` so that they run serially when `-jN` is passed to `make`. I was originally going to change `brew update >/dev/null` to `brew update >/dev/null || true` but decided the Makefile change provides a better guarantee that simultaenous `brew` commands won't interfere with each other. In the process, I revised some of the script's `echo` output just a bit.
This commit is contained in:
parent
c5f74ac2c0
commit
7eda54a141
2
Makefile
2
Makefile
|
@ -106,7 +106,7 @@ ifeq ($(detected_OS),Darwin)
|
||||||
bottles/openssl:
|
bottles/openssl:
|
||||||
./scripts/fetch-brew-bottle.sh openssl
|
./scripts/fetch-brew-bottle.sh openssl
|
||||||
|
|
||||||
bottles/pcre:
|
bottles/pcre: bottles/openssl
|
||||||
./scripts/fetch-brew-bottle.sh pcre
|
./scripts/fetch-brew-bottle.sh pcre
|
||||||
|
|
||||||
bottles: bottles/openssl bottles/pcre
|
bottles: bottles/openssl bottles/pcre
|
||||||
|
|
|
@ -21,7 +21,7 @@ function fetch_bottle() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ $(uname) != "Darwin" ]]; then
|
if [[ $(uname) != "Darwin" ]]; then
|
||||||
echo "This script is intended for use on MacOS!" >&2
|
echo "This script is intended for use on macOS!" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ GITHUB_USER="${GITHUB_USER:-_}"
|
||||||
GITHUB_TOKEN="${GITHUB_TOKEN:-_}"
|
GITHUB_TOKEN="${GITHUB_TOKEN:-_}"
|
||||||
if [[ "${GITHUB_USER}" == "_" ]] || [[ "${GITHUB_TOKEN}" == "_" ]]; then
|
if [[ "${GITHUB_USER}" == "_" ]] || [[ "${GITHUB_TOKEN}" == "_" ]]; then
|
||||||
echo "No GITHUB_USER or GITHUB_TOKEN variable set!" >&2
|
echo "No GITHUB_USER or GITHUB_TOKEN variable set!" >&2
|
||||||
echo "GitHub Packages which can throttle unauthorized requests." >&2
|
echo "GitHub Packages can throttle unauthorized requests." >&2
|
||||||
else
|
else
|
||||||
echo "${BOTTLE_NAME} - Fetching GH Pkgs Token"
|
echo "${BOTTLE_NAME} - Fetching GH Pkgs Token"
|
||||||
BEARER_TOKEN=$(get_gh_pkgs_token)
|
BEARER_TOKEN=$(get_gh_pkgs_token)
|
||||||
|
@ -47,7 +47,7 @@ fi
|
||||||
if [[ $(stat -f %u /usr/local/var/homebrew) -ne "${UID}" ]]; then
|
if [[ $(stat -f %u /usr/local/var/homebrew) -ne "${UID}" ]]; then
|
||||||
echo "Missing permissions to update Homebrew formulae!" >&2
|
echo "Missing permissions to update Homebrew formulae!" >&2
|
||||||
else
|
else
|
||||||
echo "${BOTTLE_NAME} - Updateing HomeBrew repository"
|
echo "${BOTTLE_NAME} - Updating HomeBrew repository"
|
||||||
brew update >/dev/null
|
brew update >/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ BOTTLE_JSON=$(get_bottle_json "${BOTTLE_NAME}")
|
||||||
BOTTLE_URL=$(echo "${BOTTLE_JSON}" | jq -r .url)
|
BOTTLE_URL=$(echo "${BOTTLE_JSON}" | jq -r .url)
|
||||||
BOTTLE_SHA=$(echo "${BOTTLE_JSON}" | jq -r .sha256)
|
BOTTLE_SHA=$(echo "${BOTTLE_JSON}" | jq -r .sha256)
|
||||||
|
|
||||||
echo "${BOTTLE_NAME} - Fetching bottles for macOS"
|
echo "${BOTTLE_NAME} - Fetching bottle for macOS"
|
||||||
fetch_bottle "${BOTTLE_PATH}" "${BOTTLE_URL}"
|
fetch_bottle "${BOTTLE_PATH}" "${BOTTLE_URL}"
|
||||||
trap "rm -fr ${BOTTLE_PATH}" EXIT ERR INT QUIT
|
trap "rm -fr ${BOTTLE_PATH}" EXIT ERR INT QUIT
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue