Serge Guelton via llvm-dev
2019-Dec-17 10:12 UTC
[llvm-dev] Python 2 compatibility for utility scripts
At the beginning of the year, I've landed a large set of patches to support both Python 2 and Python3 in most Python scripts. Looks like I missed some of them :-) At that time, backward portability with Python2 was still relevant, and I suspect it will still be the case for a few distributions that ship Python2 by default. That being said, Even RHEL8 uses Python3 by default, so at some point we may be able to drop the compatibility stuff. Until then, I'd argue for maintaining compatibility as it's not a tremendous task. On Tue, Dec 17, 2019 at 10:54 AM James Henderson via llvm-dev < llvm-dev at lists.llvm.org> wrote:> I personally only use Python 3 reluctantly. I've yet to encounter a > situation where I actually preferred Python 3. That being said, given the > decision to retire Python 2.7 (*grumble* *grumble*), I'll probably be > forced sometime in the new year to uninstall it by somebody in charge of > security somewhere. I certainly don't see a personal need to have all > scripts support Python 2, unless they are used in the build/test pipeline > somewhere (i.e. get touched by a fresh check-all). > > On Tue, 17 Dec 2019 at 05:31, Fangrui Song via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> https://reviews.llvm.org/D71565 intends to update >> llvm/utils/update_cc_test_checks.py to work with Python 2. >> >> In the original review, I suggested that we don't add Python 2 >> compatibility for new features because Python 2.7 is retiring and some >> Linux distributions are even deprecating/removing Python 2 support. My >> feeling is: >> >> If some utilities do not support Python 2, we should probably not bother >> making them Python 2 compatible. Maintaining Python 2/3 compatibility >> may not worth the efforts. "utilities" include some command line tools >> under llvm/utils, which are not part of instructure like lit. What do >> people think? >> >> BTW, what's the Python 3 support status of build bots? Are there any >> running Python 3? >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191217/ef13a21a/attachment-0001.html>
Nico Weber via llvm-dev
2019-Dec-17 12:43 UTC
[llvm-dev] Python 2 compatibility for utility scripts
On Tue, Dec 17, 2019 at 5:12 AM Serge Guelton <sguelton at redhat.com> wrote:> At the beginning of the year, I've landed a large set of patches to > support both Python 2 and Python3 in most Python scripts. Looks like I > missed some of them :-) > At that time, backward portability with Python2 was still relevant, and I > suspect it will still be the case for a few distributions that ship Python2 > by default. That being said, Even RHEL8 uses Python3 by default, so at some > point we may be able to drop the compatibility stuff. > Until then, I'd argue for maintaining compatibility as it's not a > tremendous task. >This is my feeling as well. In yesterday's instance, I lost more time to fixing bugs in the py3 detection logic on systems that don't have it than it took me to make the script just run fine with both Python 2 and 3. On macOS, I think 10.15 is the first version that ships with python3, and that was released just 2 months ago.> > On Tue, Dec 17, 2019 at 10:54 AM James Henderson via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> I personally only use Python 3 reluctantly. I've yet to encounter a >> situation where I actually preferred Python 3. That being said, given the >> decision to retire Python 2.7 (*grumble* *grumble*), I'll probably be >> forced sometime in the new year to uninstall it by somebody in charge of >> security somewhere. I certainly don't see a personal need to have all >> scripts support Python 2, unless they are used in the build/test pipeline >> somewhere (i.e. get touched by a fresh check-all). >> >> On Tue, 17 Dec 2019 at 05:31, Fangrui Song via llvm-dev < >> llvm-dev at lists.llvm.org> wrote: >> >>> https://reviews.llvm.org/D71565 intends to update >>> llvm/utils/update_cc_test_checks.py to work with Python 2. >>> >>> In the original review, I suggested that we don't add Python 2 >>> compatibility for new features because Python 2.7 is retiring and some >>> Linux distributions are even deprecating/removing Python 2 support. My >>> feeling is: >>> >>> If some utilities do not support Python 2, we should probably not bother >>> making them Python 2 compatible. Maintaining Python 2/3 compatibility >>> may not worth the efforts. "utilities" include some command line tools >>> under llvm/utils, which are not part of instructure like lit. What do >>> people think? >>> >>> BTW, what's the Python 3 support status of build bots? Are there any >>> running Python 3? >>> _______________________________________________ >>> LLVM Developers mailing list >>> llvm-dev at lists.llvm.org >>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >>> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191217/eddf9b30/attachment.html>
James Y Knight via llvm-dev
2019-Dec-17 14:18 UTC
[llvm-dev] Python 2 compatibility for utility scripts
IMO, having non-critical utility scripts require python 3 should be allowed now. But, not yet for any scripts which are critical to build or test the distributed components. If we need to spend some time to fix the test runner to allow properly skipping tests of python3-only components when python3 isn't available, that seems entirely worthwhile, since we only need to do that once. On Tue, Dec 17, 2019, 7:43 AM Nico Weber via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On Tue, Dec 17, 2019 at 5:12 AM Serge Guelton <sguelton at redhat.com> wrote: > >> At the beginning of the year, I've landed a large set of patches to >> support both Python 2 and Python3 in most Python scripts. Looks like I >> missed some of them :-) >> At that time, backward portability with Python2 was still relevant, and I >> suspect it will still be the case for a few distributions that ship Python2 >> by default. That being said, Even RHEL8 uses Python3 by default, so at some >> point we may be able to drop the compatibility stuff. >> Until then, I'd argue for maintaining compatibility as it's not a >> tremendous task. >> > > This is my feeling as well. In yesterday's instance, I lost more time to > fixing bugs in the py3 detection logic on systems that don't have it than > it took me to make the script just run fine with both Python 2 and 3. > > On macOS, I think 10.15 is the first version that ships with python3, and > that was released just 2 months ago. > > >> >> On Tue, Dec 17, 2019 at 10:54 AM James Henderson via llvm-dev < >> llvm-dev at lists.llvm.org> wrote: >> >>> I personally only use Python 3 reluctantly. I've yet to encounter a >>> situation where I actually preferred Python 3. That being said, given the >>> decision to retire Python 2.7 (*grumble* *grumble*), I'll probably be >>> forced sometime in the new year to uninstall it by somebody in charge of >>> security somewhere. I certainly don't see a personal need to have all >>> scripts support Python 2, unless they are used in the build/test pipeline >>> somewhere (i.e. get touched by a fresh check-all). >>> >>> On Tue, 17 Dec 2019 at 05:31, Fangrui Song via llvm-dev < >>> llvm-dev at lists.llvm.org> wrote: >>> >>>> https://reviews.llvm.org/D71565 intends to update >>>> llvm/utils/update_cc_test_checks.py to work with Python 2. >>>> >>>> In the original review, I suggested that we don't add Python 2 >>>> compatibility for new features because Python 2.7 is retiring and some >>>> Linux distributions are even deprecating/removing Python 2 support. My >>>> feeling is: >>>> >>>> If some utilities do not support Python 2, we should probably not bother >>>> making them Python 2 compatible. Maintaining Python 2/3 compatibility >>>> may not worth the efforts. "utilities" include some command line tools >>>> under llvm/utils, which are not part of instructure like lit. What do >>>> people think? >>>> >>>> BTW, what's the Python 3 support status of build bots? Are there any >>>> running Python 3? >>>> _______________________________________________ >>>> LLVM Developers mailing list >>>> llvm-dev at lists.llvm.org >>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >>>> >>> _______________________________________________ >>> LLVM Developers mailing list >>> llvm-dev at lists.llvm.org >>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >>> >> _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191217/58ee0887/attachment.html>