[llvm-dev] [RFC] Python 2 / Python 3 status

Serge Guelton via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 29 02:26:18 PST 2020


Hi folks,

Python2 has reached end of support[0], and many core Python packages are
dropping pthon 2 support[1].

This is a subject that raises periodically on this mlist, with a rather strong
no in 2018 [-1] and a slow move in 2019 [-2, -3].

Even if Python is not a core build requirement, it's used during some
configurations steps (e.g. in the cmake export_executable_symbols function),
for testing, and it is definitevely part of the user experience - several clang
tools depend on it, as well as many lldb features. So it's not only about utility
scripts.

Fedora has moved to Python3 [2], RHEL8 ships Python3 by default [3] (though
RHEL7 still ships Python2, but it has reached « End of Full Support »).
Latest OSX version also explicitly obsoletes Python2 [4]. Debian always ships
both interpreter - even in stable [5]

There has been an effort in LLVM/lldb/clang/... to make all Python scripts
portable across Python2 and Python3 version [6], but if the documentation and
``GettingStarted.rst`` is to be trust, we only require >=2.7. This may be
considered as a maintenance burden, see for instance this discussion [7]. Plus
LLVM doesn't have a strong conservative culture, e.g. wrt CMake requirements.

My personal take on this would be to start moving forward. Still supporting both
version this year, but obsoleting Python 2.7 and requiring, say Python 3.6,
starting January 2021 looks like a good compromise.

Any thoughts?

[-3] https://lists.llvm.org/pipermail/llvm-dev/2019-May/132507.html
[-2] http://lists.llvm.org/pipermail/llvm-dev/2019-December/137634.html
[-1] http://lists.llvm.org/pipermail/llvm-dev/2018-January/120826.html]
[0] https://www.python.org/dev/peps/pep-0373/#update
[1] https://python3statement.org/
[2] https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
[3] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/8.0_release_notes/index#web-servers-databases-dynamic-languages
[4] https://developer.apple.com/documentation/macos_release_notes/macos_catalina_10_15_release_notes#3318257)
[5] https://wiki.debian.org/Python
[6] https://github.com/llvm/llvm-project/search?q=python+compatibility&unscoped_q=python+compatibility&type=Commits
[7] https://reviews.llvm.org/D73011



More information about the llvm-dev mailing list