[llvm-dev] [RFC] Python 2 / Python 3 status
Serge Guelton via llvm-dev
llvm-dev at lists.llvm.org
Thu Jan 30 06:59:29 PST 2020
> If the shebang line is `#!/usr/bin/env python3` and there is no
python3.exe on PATH, that will be an error.
Anyway, has current policy supports Python 2.7, it would be some kind of
policy violation to require python 3 ,
so I don't think we should go that way until we explicitly require Python3.
Once that milestone is reached,
let's say in january, 2021, my educated guess is that python3 and python
will be equivalent on most systems and we don't need to make a move.
What about this:
1. until autumn: do nothing, try to preserve py2 / py3 compat
2. in autumn: prepare a patch that
2.1 update doc requirement, and enforces it in cmake
2.2 test that change on all buildbots
3. in winter: (snakes brumate in winter)
3.1 merge the above patch
3.2 iteratively remove compatibility layer wherever it makes sense, in
an iterative, distributed manner
Concerning 2.2, buildbot being an old python package, it may live on old
machine with only python2, there may be some friction. that being said,
Buildbot no longer supports Python 2.7 on the Buildbot master...
I don't know if 3.2 makes sense, or if we should just keep existing code as
is, and just don't care about compatibility for newer code.
The good thing is that 3.2 can span over multiple people and over time.
 as of 058070893428a480b76a137f647ae6b9c89ac2d4, the only scripts that
explicitly require python3 are the following:
./polly/test/update_check.py:#! /usr/bin/env python3
On Wed, Jan 29, 2020 at 10:26 PM Reid Kleckner via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> On Wed, Jan 29, 2020 at 1:12 PM Tobias Hieta via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>> On Wed, Jan 29, 2020, 21:30 Fangrui Song via llvm-dev <
>> llvm-dev at lists.llvm.org> wrote:
>>> I also recall Reid said `#!/usr/bin/env python` might make Windows
>>> developers happier but I forget the details.
>> Python on windows has a wrapper that parses this line and selects which
>> python to use bases on that.
> I believe many developers develop from the "git bash" msys shell. In this
> context, bash will interpret the shebang line. If the shebang line is
> `#!/usr/bin/env python3` and there is no python3.exe on PATH, that will be
> an error.
> For the Linux distros that are removing Python 2, will "python" find
> Python 3 in the future, or will we have to say "python3" explicitly?
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev