Commit Graph

14 Commits (main)

Author SHA1 Message Date
Brian Ryner 8d81365cf0 Use the bundled interpreter instead of passing -vpython-interpreter.
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>
3 years ago
Brian Ryner b8a4c0ba65 The python3 bin directory no longer needs to be added to PATH.
Bug: 1003139
Change-Id: Iaa288b8b4b2090ac055f53b6b0e116a7874e8bee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3570881
Reviewed-by: Chenlin Fan <fancl@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Brian Ryner <bryner@google.com>
3 years ago
Bruce Dawson c4b1b772bc Prevent path-pollution from vpython3.bat
vpython3.bat adds an entry to the path. Unfortunately that modification
persists after the batch file returns. Repeated running of vpython3.bat
will eventually grow the path so long that the command to update the
path exceeds the 8191 character cmd.exe command-length limit. This can
most easily be seen by repeatedly running this command:

    vpython3 -c "print('Hello world!')" && set path | wc

After about 35 invocations (dependent on exact system setup) this
happens:

    >vpython3 -c "print('Hello world!')" && set path | wc
    The input line is too long.
    The syntax of the command is incorrect.

This batch also (but less critically) leaks the PYTHON3_BIN_RELDIR
environment variable.

The fix is to add a setlocal command to keep environment changes local.

Bug: 1003139
Change-Id: I11a31e1013017da702299bfe8eb4888985c228f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3566378
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Brian Ryner <bryner@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
3 years ago
Josip Sokcevic 6ec83a2426 Revert "Add VPYTHON_BYPASS support for vpython on Windows"
This reverts commit bc93924b3b.

Reason for revert: https://crbug.com/1308393

Original change's description:
> Add VPYTHON_BYPASS support for vpython on Windows
>
> At Postman, we use a custom build of Electron which is built using a set
> of tools that are managed by us. Till now, we were using the
> VPYTHON_BYPASS environment variable to use our own managed version of
> Python on macOS but unfortunately, on Windows, depot_tools doesn't
> respect the value of this variable, so this change adds support for that
> on Windows too.
>
> Signed-off-by: Darshan Sen <raisinten@gmail.com>
> Change-Id: I63da0495463ace87d34c3c6fad1c03dee108d14b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3525642
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>

Bug: 1308393
Change-Id: I8cea8827e185d516b8f860b2aa8a8f21a75a8b1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3539039
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Darshan Sen bc93924b3b Add VPYTHON_BYPASS support for vpython on Windows
At Postman, we use a custom build of Electron which is built using a set
of tools that are managed by us. Till now, we were using the
VPYTHON_BYPASS environment variable to use our own managed version of
Python on macOS but unfortunately, on Windows, depot_tools doesn't
respect the value of this variable, so this change adds support for that
on Windows too.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
Change-Id: I63da0495463ace87d34c3c6fad1c03dee108d14b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3525642
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Josip Sokcevic 7e0b333328 Fix git-* commands when using python3 on Win
R=ehmaldonado@chromium.org

Bug: 1065582
Change-Id: I434db17d4113cdf623ad733b65aa66b770766fb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2131468
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Edward Lesmes 17aaea21d4 Reland "depot_tools: Run using Python 3 by default."
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>
5 years ago
Josip Sokcevic e2ac022f0b Revert "Reland "depot_tools: Run using Python 3 by default.""
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>
5 years ago
Edward Lesmes e9013eeb3d 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>
5 years ago
Edward Lesmes dfadd9d7a2 Reland "vpython: Specify interpreter to run."
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>
5 years ago
Edward Lesmes 13928b7e7f Revert "vpython: Specify interpreter to run."
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>
5 years ago
Edward Lesmes 797d74a266 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>
5 years ago
Edward Lesmes b92d20526b vpython3: Add Python3 bin dir to PATH on Windows
As a workaround, add the Python3 bin dir to PATH so that the necessary DLLs are available.

Bug: 1003139
Change-Id: I7b3e05922be3fcb7b0ec2b06783a86f25484310b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1992270
Reviewed-by: smut <smut@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
smut 447b45d423 [vpython] Roll to 98a268c6432f18aedd55d62b9621765316dc2a16
Newer builds of vpython contain vpython3 as well.

Bug: 898348
Change-Id: I63b197690e2ae47bd4c6cd50894c4769e1a18334
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1727581
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: smut <smut@google.com>
6 years ago