-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devops(chromium): missing depot tools in prepare_checkout.sh script (#…
…5525) Make sure `prepare_checkout.sh` has depot_tools in its PATH. Drive-by: enable goma compiler proxy auto-restart.
- Loading branch information
1 parent
57c7a70
commit c57f1fc
Showing
4 changed files
with
35 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Since this script modifies PATH, it cannot be run in a subshell | ||
# and must be sourced. | ||
# Make sure it is sourced. | ||
sourced=0 | ||
(return 0 2>/dev/null) && sourced=1 || sourced=0 | ||
|
||
if [[ $sourced == 0 ]]; then | ||
echo 'ERROR: cannot run this script in a subshell' | ||
echo 'This file modifies $PATH of the current shell, so it must be sourced instead' | ||
echo 'Use `source ensure_depot_tool.sh` instead' | ||
exit 1 | ||
fi | ||
|
||
# Install depot_tools if they are not in system, and modify $PATH | ||
# to include depot_tools | ||
if ! command -v autoninja >/dev/null; then | ||
if [[ $(uname) == "MINGW"* ]]; then | ||
# NOTE: as of Feb 8, 2021, windows requires manual and separate | ||
# installation of depot_tools. | ||
echo "ERROR: cannot automatically install depot_tools on windows. Please, install manually" | ||
exit 1 | ||
fi | ||
SCRIPT_PATH=$(cd "$(dirname "$BASH_SOURCE")"; pwd -P) | ||
if [[ ! -d "${SCRIPT_PATH}/depot_tools" ]]; then | ||
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git "${SCRIPT_PATH}/depot_tools" | ||
fi | ||
export PATH="${SCRIPT_PATH}/depot_tools:$PATH" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters