Reland "depot_tools: Bootstrap Python 3 on Linux/Mac"

Don't call ensure_bootstrap from update_depot_tools.
ensure_bootstrap also updates gsutil and all versions of pylint
which is slow, particularly on MinGW.

Original change's description:
> depot_tools: Bootstrap Python 3 on Linux/Mac
>
> This will make it possible for developers to execute depot_tools
> scripts using Python 3 in a known environment.
>
> Bug: 1002153
> Change-Id: I5ff492a49d227c1b5876f49adba020f51a575bdd
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1762664
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>

Bug: 1002153
Change-Id: Ia7579e440438897ba4a7c65a8b228dcfe7f28c86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1810040
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This commit is contained in:
Edward Lemur
2019-09-18 18:31:07 +00:00
committed by Commit Bot
parent 3f79763629
commit 24995256ee
21 changed files with 185 additions and 106 deletions

View File

@@ -45,7 +45,7 @@ fi
# We want to update the bundled tools even under MinGW.
if [ $MINGW = 0 ]; then
$COMSPEC /c `cygpath -w "$base_dir/bootstrap/win/win_tools.bat"`
$COMSPEC /c `cygpath -w "$base_dir/bootstrap/win_tools.bat"`
case $? in
123)
# msys environment was upgraded, need to quit.
@@ -118,10 +118,15 @@ if [ "X$DEPOT_TOOLS_UPDATE" != "X0" ]; then
cd - > /dev/null
fi
# Sync CIPD and CIPD client tools.
# Sync CIPD-boostrapped packages.
source "$base_dir/cipd_bin_setup.sh"
cipd_bin_setup
find "$base_dir" | grep -i ".*\.pyc" | xargs rm -f;
# Don't bootstrap Python 3 on windows, since it is already done by
# bootstrap/win_tools.bat.
if [ "X$MINGW" != "X0" -a "X$DEPOT_TOOLS_BOOTSTRAP_PYTHON3" != "X0" ]; then
source "$base_dir/bootstrap_python3"
bootstrap_python3
fi
fi