<div dir="ltr">Sadly, neither the latest version of RedHat (released in 2014), nor the latest version of macOS (released in 2017) have any version of python3 available with the default system. On the other hand, TTBOMK, every system that does have python3 available also makes python2.7 also easily available.<div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">LLVM is not a primarily python project, so keeping up with the latest features of the language, and making them available for developers of LLVM is not terribly interesting (contrast with C++ -- enabling developers of LLVM to use new C++ features does have a lot of value). There's also no particular reason to think that developers will have already installed the latest version of python on their systems, if it takes effort to do so.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Python is used here as a convenient scripting language primarily because it is commonly/conveniently available across platforms. Requiring a python version which does not have the widespread availability (and without a compelling reason to want the higher version, other than that it's newer) does not seem to make much sense.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div>So, ISTM that unfortunately, the decision to require python3 for is still premature, even some 10 years after its initial release. (Whether that state of the world is ridiculous, or whose fault that is, is irrelevant here; anyone who wants to have that discussion can go have it on python-dev for the 20000th time.)</div><div><br></div><div>That said, I do think it could make sense to prepare llvm for the world in which "python" is python3 on some systems. So, I'd propose the following:</div><div>1. Change all #! lines to say "#!/usr/bin/env python2.7" instead of "#!/usr/bin/env python", if they only work with 2.7.</div><div>2. If someone feels motivated, and if it doesn't make the code obtuse, port scripts to work with either version -- and for such scripts, change the #! line to say "#!/usr/bin/env python".</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 1, 2018 at 3:05 AM, Dimitry Andric via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You might want to tell that to the Prominent North American Enterprise Linux Vendor that everybody is using... :)<br>
<br>
-Dimitry<br>
<div class="HOEnZb"><div class="h5"><br>
> On 1 Feb 2018, at 06:28, Tim Northover via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Since we seem to be voting, I'll -1 it. It's pretty ridiculous to have<br>
> a system without Python 3 in 2018 and anyone supplying such a<br>
> monstrosity should be encouraged to stop it.<br>
><br>
> Tim.<br>
><br>
> On 1 February 2018 at 05:20, Philip Reames via llvm-dev<br>
> <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> +1 to what Chris and Justin said.<br>
>><br>
>> I see no strong benefit to moving to python3 and substantial costs.<br>
>><br>
>> Philip<br>
>><br>
>><br>
>> On 01/30/2018 11:20 AM, Chris Matthews via llvm-dev wrote:<br>
>><br>
>> Personally, every machine I work with only has Python 2.7.<br>
>><br>
>> Justin is correct that there is a non-trivial amount of effort to convert<br>
>> the bots.<br>
>><br>
>> Python 3 is wonderful. But, a Python 3 dependency seems like one burden that<br>
>> could be avoided.  We have already made that trade-off in the past, for<br>
>> example by only using standard python packages, so there is less/nothing to<br>
>> pip install when getting started.  Dependencies likes host compiler and<br>
>> cmake totally make sense given they are central to how LLVM is made.  I<br>
>> don’t think the same for the python code.<br>
>><br>
>> I’m in favor of 2/3 compatibility until the death clock ends.<br>
>><br>
>> On Jan 30, 2018, at 4:48 AM, 陳韋任 via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
>> wrote:<br>
>><br>
>> Does Python 3 have feature we want to use in LLVM codebase, and no<br>
>> workaround there? If so, please give some examples. I think that makes the<br>
>> discussion more concrete.<br>
>><br>
>> 2018-01-30 4:46 GMT+08:00 Fāng-ruì Sòng via llvm-dev<br>
>> <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>>:<br>
>>><br>
>>> Hi LLVM-Devs,<br>
>>><br>
>>> I noticed that many Python scripts under utils/ have a shebang of<br>
>>> `#!/usr/bin/python` (which is a symlink to python2.7 on many platforms)<br>
>>> and some of them use Python 2 syntax that is not compatible with Python 3<br>
>>> (e.g. print statements; str/bytes)<br>
>>><br>
>>> I created a revision to migrate utils/update_{llc_,}_test_<wbr>checks.py from<br>
>>> Python 2 to Python 3 <a href="https://reviews.llvm.org/D42450" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D42450</a> , the arguments against<br>
>>> making it Python 3 is:<br>
>>><br>
>>> * There are many Mac OS X users and Mac OS X 10.8 comes with Python 2.7<br>
>>> pre-installed [0] but not Python 3.<br>
>>> * Forcing scripts to use Python 3 (by doing so we can avoid some<br>
>>> compatibility trouble) may not be a good idea.<br>
>>><br>
>>> Python 2.7 was published in 2010 and planned as the last of the 2.x<br>
>>> releases. It will not be maintained past 2020 and there is also a retirement<br>
>>> page <a href="https://pythonclock.org/" rel="noreferrer" target="_blank">https://pythonclock.org/</a> .<br>
>>><br>
>>> The second argument would not need to be addressed if the first one did<br>
>>> not lay too much burden on developers. After all, we have to install `cmake,<br>
>>> ninja/GNU Make / libedit(for lldb)` to build LLVM. These packages are not<br>
>>> installed by default on many platforms.<br>
>>><br>
>>> Thoughts on deprecating Python 2 for utils/ scripts (different from<br>
>>> libclang or lldb scripts) which are not user-facing?<br>
>>><br>
>>> [0]:<br>
>>> <a href="https://docs.python.org/3/using/mac.html#getting-and-installing-macpython" rel="noreferrer" target="_blank">https://docs.python.org/3/<wbr>using/mac.html#getting-and-<wbr>installing-macpython</a><br>
>>><br>
>>><br>
>>> Thanks,<br>
>>> Fangrui<br>
>>> ______________________________<wbr>_________________<br>
>>> LLVM Developers mailing list<br>
>>> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Wei-Ren Chen (陳韋任)<br>
>> Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" rel="noreferrer" target="_blank">https://people.cs.nctu.edu.tw/<wbr>~chenwj</a><br>
>> ______________________________<wbr>_________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
>><br>
>><br>
>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
>><br>
>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
>><br>
> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br>
</div></div><br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>