Updates:
Cc:
pyt...@chromium.orgComment #9 on issue 1109180 by
dpr...@google.com: a python2 precompiled binary should be provided for modern Linux distros
https://bugs.chromium.org/p/chromium/issues/detail?id=1109180#c9cc'ing a few folks that have been involved in this in the past.
I think we need to be careful in thinking about if and how we want to do this, because we've seen in the past breakages come up and it seems even more likely to break things if we mess with python2 on non-Windows platforms.
My rough understanding of the state of the world is something like the following:
- on non-Windows, we always assume there is a system python 2 installed; on Windows we assume there isn't one.
- we never assume there is a python 3 installed.
- on non-Windows, we don't provide a $depot_tools/python3 (bash) wrapper, but we do provide a $depot_tools/python-bin/python3 (bash) wrapper
- on Windows, we provide a $depot_tools/python3.bat and a $depot_tools/python-bin/python3.bat
- on Windows, we use $depot_tools/bootstrap-$PYTHON3_VERSION to hold python2 and python3 initially; the final bootstrapping phase copies those out to $depot_tools.
- on non-Windows we (re-)use the bootstrap directory for a python3 executable. We have a checked-in python3-bin/python3 (bash) wrapper that points to it.
I'm not sure if the bootstrap-$PYTHON3_VERSION directory is (directly) used post-bootstrapping. It is somewhat confusing if we do, because python-$PYTHON3_VERSION/python/bin/python.exe is a python2 executable, not a python3 executable (the python3 executable lives in .../python3/bin/).
I think this bug is potentially looking for a few different things:
1) providing a 'python' binary *somewhere* in depot_tools *that is python 2* on non-Windows.
2) providing a 'python2' binary *somewhere* in depot_tools for non-Windows platforms.
3) providing a 'python' "in-path", i.e. $depot_tools/python`
3a) providing a 'python' "in-path" that is explicitly python2
1) seems reasonable.
2) seems reasonable, but perhaps not all that useful if too many of our scripts assume the python2 thing is called 'python'.
I think we've seen that 3) and 3a) are dangerous, based on our experience with `python3`. Overriding `python2` would presumably be similarly dangerous, and overriding `python` would be presumably much worse on distros that expected `python` to refer to `python3`.
We could adopt a convention like:
- anything that assumes `/usr/bin/env python` must run under both 2 and 3
- anything that assumes `/usr/bin/env python3` must run under 3 (probably don't care if it also runs under 3)
- anything that assumes `/usr/bin/env python2` must run under 2 (probably don't care if it also runs under 2)
I don't know if the broader Python community will guarantee the following things:
- a new (3.8+) Python install will ensure a `python3` exists
- a new (3.8+) Python install will ensure a `python` exists
I assume most distros will do one or the other. I don't know how many will do both, and whether a distro would only provide a `python` if `python2` was not already installed.
PEP-394 seems to explicitly leave some of this open, though it guarantees that a `python` inside a virtualenv will exist. I also don't know how widely PEP-394 is followed.
--
You received this message because:
1. You were specifically CC'd on the issue
You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settingsReply to this email to add a comment or make updates.