Skip to content

Commit 3ce0dbb

Browse files
[lldb] Recommend Python 3.8 as the minimum Python version for LLDB (#114807)
See https://discourse.llvm.org/t/rfc-lets-document-and-enforce-a-minimum-python-version-for-lldb/82731 for discussions. This matches LLVM's requirement to run tests. For LLDB 20 there will be a CMake warning telling builders that from LLDB 21 this will be a hard requirement. From LLDB 21, it will be an error to try to build with anything <= 3.8. So there are no code changes in this commit. Once the llvm 20 branch is created we can remove some < 3.8 support code. As always, if you disable Python support you will not get any new warnings or errors from this change.
1 parent 5a1f239 commit 3ce0dbb

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

lldb/cmake/modules/FindPythonAndSwig.cmake

+6
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,9 @@ else()
6464
Python3_EXECUTABLE
6565
LLDB_ENABLE_SWIG)
6666
endif()
67+
68+
set(LLDB_RECOMMENDED_PYTHON "3.8")
69+
if(PYTHONANDSWIG_FOUND AND "${Python3_VERSION}" VERSION_LESS "${LLDB_RECOMMENDED_PYTHON}")
70+
message(WARNING "Using Python ${Python3_VERSION}. ${LLDB_RECOMMENDED_PYTHON} "
71+
"is recommended and will be required from LLDB 21.")
72+
endif()

lldb/docs/resources/build.rst

+16-16
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,21 @@ CMake flag to ``On`` or ``Off`` to force the dependency to be enabled or
5151
disabled. When a dependency is set to ``On`` and can't be found it will cause a
5252
CMake configuration error.
5353

54-
+-------------------+------------------------------------------------------+--------------------------+
55-
| Feature | Description | CMake Flag |
56-
+===================+======================================================+==========================+
57-
| Editline | Generic line editing, history, Emacs and Vi bindings | ``LLDB_ENABLE_LIBEDIT`` |
58-
+-------------------+------------------------------------------------------+--------------------------+
59-
| Curses | Text user interface | ``LLDB_ENABLE_CURSES`` |
60-
+-------------------+------------------------------------------------------+--------------------------+
61-
| LZMA | Lossless data compression | ``LLDB_ENABLE_LZMA`` |
62-
+-------------------+------------------------------------------------------+--------------------------+
63-
| Libxml2 | XML | ``LLDB_ENABLE_LIBXML2`` |
64-
+-------------------+------------------------------------------------------+--------------------------+
65-
| Python | Python scripting | ``LLDB_ENABLE_PYTHON`` |
66-
+-------------------+------------------------------------------------------+--------------------------+
67-
| Lua | Lua scripting. Lua 5.3 and 5.4 are supported. | ``LLDB_ENABLE_LUA`` |
68-
+-------------------+------------------------------------------------------+--------------------------+
54+
+-------------------+--------------------------------------------------------------+--------------------------+
55+
| Feature | Description | CMake Flag |
56+
+===================+==============================================================+==========================+
57+
| Editline | Generic line editing, history, Emacs and Vi bindings | ``LLDB_ENABLE_LIBEDIT`` |
58+
+-------------------+--------------------------------------------------------------+--------------------------+
59+
| Curses | Text user interface | ``LLDB_ENABLE_CURSES`` |
60+
+-------------------+--------------------------------------------------------------+--------------------------+
61+
| LZMA | Lossless data compression | ``LLDB_ENABLE_LZMA`` |
62+
+-------------------+--------------------------------------------------------------+--------------------------+
63+
| Libxml2 | XML | ``LLDB_ENABLE_LIBXML2`` |
64+
+-------------------+--------------------------------------------------------------+--------------------------+
65+
| Python | Python scripting. >= 3.0 is required, >= 3.8 is recommended. | ``LLDB_ENABLE_PYTHON`` |
66+
+-------------------+--------------------------------------------------------------+--------------------------+
67+
| Lua | Lua scripting. Lua 5.3 and 5.4 are supported. | ``LLDB_ENABLE_LUA`` |
68+
+-------------------+--------------------------------------------------------------+--------------------------+
6969

7070
Depending on your platform and package manager, one might run any of the
7171
commands below.
@@ -75,7 +75,7 @@ commands below.
7575
$ yum install libedit-devel libxml2-devel ncurses-devel python-devel swig
7676
$ sudo apt-get install build-essential swig python3-dev libedit-dev libncurses5-dev libxml2-dev
7777
$ pkg install swig python libxml2
78-
$ pkgin install swig python36 cmake ninja-build
78+
$ pkgin install swig python38 cmake ninja-build
7979
$ brew install swig cmake ninja
8080

8181
.. note::

0 commit comments

Comments
 (0)