Many tools use vpython so we can avoid pyc writes by
disabling them at this layer.
Bug: b/320565954
Change-Id: I50cd04968810ecc186d5abe6c67e54ae1647c739
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5812665
Commit-Queue: Erik Staab <estaab@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
So that it allows depot tools has the ability to write the cipd pkgs
outside of the repo.
windows support will be added in a follow-up change.
Bug: 355430412
Change-Id: I7fabed7ecac8216ba3f3f639217d9e36746241f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5742434
Reviewed-by: Gregory Guterman <guterman@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Once we're done using DEPOT_TOOLS_DIR to bootstrap ourselves, remove
it from the env so it isn't passed to the python script which might
in turn run commands from other depot_tools trees. Like gclient and
running chromium/src/third_party/depot_tools/ programs.
Bug: 1470590
Change-Id: I3dee847e45896ee25f01054026805277fc373c37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4764126
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Avoid recomputing this value multiple times between vpython & cipd.
Bug: 1469696
Change-Id: If82d58180f94cb2833a5a177f7b1e431e08f2892
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4750040
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
A lot of scripts like to compute the dirname of $0 to find itself to
load more files. Have some scripts export & resuse this value so we
avoid recalculating when not needed.
Bug: 1469696
Change-Id: I3aac2e6119dbfa3c68715208df2786f67cdce92e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4750430
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
This reverts commit c962e86f7b.
Reason for revert: broke MacOS:
realpath: command not found
Original change's description:
> Resolve symlinks to cipd, vpython3
>
> If we point a symlink at vpython3 (or various other tools), it will try
> to resolve the depot_tools path to wherever that symlink is stored. We
> should instead follow the symlink before determining the path.
>
> Prior art:
>
> * in python, we're doing Path.resolve() in many cases
> * in shell, there's a "$(readlink "$(dirname "$0"))" (man/push_to_gs.sh)
>
> BUG=b:270994985
> TEST=symlink to vpython3 works
>
> Change-Id: Ifee014d2571ccf58d830a2702c8a0ea225dd4821
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4295094
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Brian Norris <briannorris@chromium.org>
Bug: b:270994985
Change-Id: I69342f3a52153b8cb1ed4366ede5883dfe5ec0b9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4310530
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
If we point a symlink at vpython3 (or various other tools), it will try
to resolve the depot_tools path to wherever that symlink is stored. We
should instead follow the symlink before determining the path.
Prior art:
* in python, we're doing Path.resolve() in many cases
* in shell, there's a "$(readlink "$(dirname "$0"))" (man/push_to_gs.sh)
BUG=b:270994985
TEST=symlink to vpython3 works
Change-Id: Ifee014d2571ccf58d830a2702c8a0ea225dd4821
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4295094
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Brian Norris <briannorris@chromium.org>
Once this is rolled out, we will no longer need to bootstrap python(3)
in the vpython wrapper, only vpython itself.
Bug: 1318617
Change-Id: If11b81f19d1d15eda74aae94ddc95c2997148c8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3760318
Reviewed-by: Chenlin Fan <fancl@chromium.org>
Commit-Queue: Brian Ryner <bryner@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Check `if [[ $(uname -s) = MINGW* ]]` instead of using
grepping and an additional variable.
Change-Id: I6f2cfbb6743357125e6672b77667ee5e36d3d81e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2127674
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
This allows git-cl to run successfully when the depot tools are installed to a path with a space in it.
Change-Id: I79fa44d13f89fb0ee1baaa90961b4c4284913c40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2125626
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit e2ac022f0b.
git-cache issues were solved by https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2120966
Original change's description:
> Reland "depot_tools: Run using Python 3 by default."
>
> This is a reland of 01ed358917
>
> * python_runner.sh, gclient, roll-dep and fetch will call vpython
> (instead of vpython3) when running on Windows under git-bash.
> * vpython3 now detects when running on Windows under git-bash and
> executes vpython3.bat instead.
> * vpython3.bat calls python3.exe directly instead of calling python3.bat.
>
> Original change's description:
> > depot_tools: Run using Python 3 by default.
> >
> > Run gclient, roll-dep, fetch and custom git commands (i.e. git-cl, git-rebase-update, git-new-branch, etc.)
> > using vpython3 by default.
> >
> > Change-Id: I4eecddafa6ca4c5f82ec097615c79d2a741613e7
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2113550
> > Reviewed-by: Anthony Polito <apolito@google.com>
> > Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
>
> Change-Id: I9829141d7ea26a67e655264430151f493e73a930
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2118418
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Anthony Polito <apolito@google.com>
Change-Id: Iff02533f0a11062f335a010c074043c720d5b2ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2121304
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit e9013eeb3d.
Reason for revert: https://crbug.com/1064547
Original change's description:
> Reland "depot_tools: Run using Python 3 by default."
>
> This is a reland of 01ed358917
>
> * python_runner.sh, gclient, roll-dep and fetch will call vpython
> (instead of vpython3) when running on Windows under git-bash.
> * vpython3 now detects when running on Windows under git-bash and
> executes vpython3.bat instead.
> * vpython3.bat calls python3.exe directly instead of calling python3.bat.
>
> Original change's description:
> > depot_tools: Run using Python 3 by default.
> >
> > Run gclient, roll-dep, fetch and custom git commands (i.e. git-cl, git-rebase-update, git-new-branch, etc.)
> > using vpython3 by default.
> >
> > Change-Id: I4eecddafa6ca4c5f82ec097615c79d2a741613e7
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2113550
> > Reviewed-by: Anthony Polito <apolito@google.com>
> > Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
>
> Change-Id: I9829141d7ea26a67e655264430151f493e73a930
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2118418
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Anthony Polito <apolito@google.com>
TBR=ehmaldonado@chromium.org,ajp@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com
Change-Id: Ia382d6e4e330f5a7a7a62e4d369c3fa16fc17333
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2120956
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This is a reland of 01ed358917
* python_runner.sh, gclient, roll-dep and fetch will call vpython
(instead of vpython3) when running on Windows under git-bash.
* vpython3 now detects when running on Windows under git-bash and
executes vpython3.bat instead.
* vpython3.bat calls python3.exe directly instead of calling python3.bat.
Original change's description:
> depot_tools: Run using Python 3 by default.
>
> Run gclient, roll-dep, fetch and custom git commands (i.e. git-cl, git-rebase-update, git-new-branch, etc.)
> using vpython3 by default.
>
> Change-Id: I4eecddafa6ca4c5f82ec097615c79d2a741613e7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2113550
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Change-Id: I9829141d7ea26a67e655264430151f493e73a930
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2118418
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
This is a reland of 797d74a266
Original change's description:
> vpython: Specify interpreter to run.
>
> Specify the interpreter to run to avoid issues with several
> python installations on Windows.
>
> Bug: 1036606
>
> Change-Id: Ib70d041acc52c940711460219acd8f4ad58637a9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1992608
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Bug: 1036606
Change-Id: Ibf6727249b40c5a9f5f877353c8d42fe66404cf8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1994215
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit 797d74a266.
Reason for revert: Causes pylint to fail executing on "Depot Tools Presubmit (win)".
Original change's description:
> vpython: Specify interpreter to run.
>
> Specify the interpreter to run to avoid issues with several
> python installations on Windows.
>
> Bug: 1036606
>
> Change-Id: Ib70d041acc52c940711460219acd8f4ad58637a9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1992608
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
TBR=ehmaldonado@chromium.org,apolito@google.com
Change-Id: I5902ceb9db85fdad81e781b51281fba8534a99d5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1036606
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1994114
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Specify the interpreter to run to avoid issues with several
python installations on Windows.
Bug: 1036606
Change-Id: Ib70d041acc52c940711460219acd8f4ad58637a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1992608
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
pythond and python3 are still downloaded from cipd, but python3 is no longer shim'd into
depot_tools on Linux, so is not available on PATH.
Modify PATH in vpython and vpython3 on Linux to point to the python3 download directory,
so that the version downloaded from cipd is used.
Bug: 1017812
Change-Id: I70bc8e7d460f60dcbfa5e141127edecfc2b44744
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1893982
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>