New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 777069 link

Starred by 7 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug


Show other hotlists

Hotlists containing this issue:
Hotlist-1


Sign in to add a comment

Update depot_tools to refer to python2 explicitly

Project Member Reported by reillyg@chromium.org, Oct 21 2017

Issue description

According to PEP 394 (https://www.python.org/dev/peps/pep-0394/) scripts which only work under Python 2 should explicitly refer to the python2 binary instead of the python binary as some distributions alias this to python3.
 

Comment 1 by jda...@gmail.com, Oct 31 2017

In particular, this applies to Arch Linux's default configuration.
Cc: iannucci@chromium.org
Status: Available (was: Untriaged)
All of our scripts run on all platforms, and that PEP explicitly excludes windows, saying that the problem is "too complex to handle".

Robbie, do you know if amending our shebang lines to all be "python2" would work on our *nix distributions, and would work on our depot_tools hermetic python installs?
The "too complex to handle" portion is regarding being able to execute the scripts directly (`foo.py` instead of `python foo.py`), since Windows doesn't natively support shebangs, instead relying on a file-type=>application mapping) This was solved for Windows by having a `py` launcher command that will parse the shebang line and run the correct python in accordance with PEP394.

But if you're running explicitly with `python`, as depot_tools does, PEP394 is the chosen reasonable solution to ensure portability.

I did discover that the python.org Windows downloads do not include aliases for python2/python3, but those are easy enough to add. (It looks like depot_tools already adds a `python` alias on Windows)
Owner: aga...@chromium.org
Status: Started (was: Available)
Welp, we'll see if this works :)

https://chromium-review.googlesource.com/#/c/chromium/tools/depot_tools/+/756208

Comment 6 by aga...@chromium.org, Nov 16 2017

 Issue 782495  has been merged into this issue.
Cc: sindhu.chelamcherla@chromium.org
 Issue 820717  has been merged into this issue.

Comment 8 by sl1pk...@gmail.com, May 6 2018

i'm not sure if this the rigth bug to post this, but, seems need also edit these files

    build/download_nacl_toolchains.py
    build/linux/unbundle/remove_bundled_libraries.py
    build/linux/unbundle/replace_gn_files.py
    tools/clang/scripts/update.py
    tools/gn/bootstrap/bootstrap.py
    third_party/dom_distiller_js/protoc_plugins/*.py
    third_party/ffmpeg/chromium/scripts/build_ffmpeg.py
    third_party/ffmpeg/chromium/scripts/generate_gn.py

this files also point to python instead of python2

greetings

Comment 9 by sl1pk...@gmail.com, May 6 2018

seems all nacl/pnacl (nacl_client) need set also python2 in all scripts
Owner: ----
Status: Available (was: Started)
Unassigning from myself because I'm on sabbatical.
Cc: thomasanderson@chromium.org
Cc: -iannucci@chromium.org iannu...@google.com

Sign in to add a comment