Skip to content

Commit e0053bc

Browse files
committed
[lldb] Bump SWIG minimum version to 4
SWIG 4 was released in 2019 and has been the de-facto standard for a while now. All bots are running SWIG 4.0 or later. This was motivated by #64279 which discovered that 662548c broke the LLDB build with SWIG 3 on Windows. Differential revision: https://reviews.llvm.org/D156804
1 parent 043d03d commit e0053bc

File tree

9 files changed

+5
-20
lines changed

9 files changed

+5
-20
lines changed

lldb/bindings/python/python.swig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ except ImportError:
5252
# Relative import should work if we are being loaded by Python.
5353
from . import $module"
5454
%enddef
55-
// These versions will not generate working python modules, so error out early.
56-
#if SWIG_VERSION >= 0x030009 && SWIG_VERSION < 0x030011
57-
#error Swig versions 3.0.9 and 3.0.10 are incompatible with lldb.
58-
#endif
5955

6056
// The name of the module to be created.
6157
%module(docstring=DOCSTRING, moduleimport=MODULEIMPORT) lldb

lldb/cmake/modules/FindLuaAndSwig.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ else()
1515
LUA_INCLUDE_DIR)
1616
endif()
1717
else()
18-
message(STATUS "SWIG 3 or later is required for Lua support in LLDB but could not be found")
18+
message(STATUS "SWIG 4 or later is required for Lua support in LLDB but could not be found")
1919
endif()
2020

2121

lldb/cmake/modules/FindPythonAndSwig.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ else()
4040
if (LLDB_ENABLE_SWIG)
4141
FindPython3()
4242
else()
43-
message(STATUS "SWIG 3 or later is required for Python support in LLDB but could not be found")
43+
message(STATUS "SWIG 4 or later is required for Python support in LLDB but could not be found")
4444
endif()
4545

4646
get_property(MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)

lldb/cmake/modules/LLDBConfig.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ macro(add_optional_dependency variable description package found)
5050
message(STATUS "${description}: ${${variable}}")
5151
endmacro()
5252

53-
add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 3)
53+
add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 4)
5454
add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND)
5555
add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" CursesAndPanel CURSESANDPANEL_FOUND)
5656
add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND)

lldb/docs/resources/build.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ If you want to run the test suite, you'll need to build LLDB with Python
3434
scripting support.
3535

3636
* `Python <http://www.python.org/>`_
37-
* `SWIG <http://swig.org/>`_ 3 or later.
37+
* `SWIG <http://swig.org/>`_ 4 or later.
3838

3939
Optional Dependencies
4040
*********************

lldb/test/API/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ def test_SBDebugger(self):
117117

118118
sb_debugger.fuzz_obj(obj)
119119

120-
# darwin: This test passes with swig 3.0.2, fails w/3.0.5 other tests fail
121-
# with 2.0.12 http://llvm.org/pr23488
122120
def test_SBError(self):
123121
obj = lldb.SBError()
124122
if self.TraceOn():
@@ -225,9 +223,6 @@ def test_SBListener(self):
225223

226224
sb_listener.fuzz_obj(obj)
227225

228-
# Py3 asserts due to a bug in SWIG. Trying to upstream a patch to fix
229-
# this in 3.0.8
230-
@skipIf(py_version=[">=", (3, 0)], swig_version=["<", (3, 0, 8)])
231226
def test_SBModule(self):
232227
obj = lldb.SBModule()
233228
if self.TraceOn():

lldb/test/API/python_api/lldbutil/TestSwigVersion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ def test(self):
2121
self.assertTrue(getattr(lldb, "swig_version"))
2222
self.assertIsInstance(lldb.swig_version, tuple)
2323
self.assertEqual(len(lldb.swig_version), 3)
24-
self.assertGreaterEqual(lldb.swig_version[0], 1)
24+
self.assertGreaterEqual(lldb.swig_version[0], 4)
2525
for v in lldb.swig_version:
2626
self.assertGreaterEqual(v, 0)

lldb/test/API/python_api/module_section/TestModuleAndSection.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111

1212
class ModuleAndSectionAPIsTestCase(TestBase):
13-
# Py3 asserts due to a bug in SWIG. A fix for this was upstreamed into
14-
# SWIG 3.0.8.
15-
@skipIf(py_version=[">=", (3, 0)], swig_version=["<", (3, 0, 8)])
1613
def test_module_and_section(self):
1714
"""Test module and section APIs."""
1815
self.build()

lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ def setUp(self):
2020
# Find the line number to break at.
2121
self.line = line_number("main.cpp", "// Break at this line")
2222

23-
# Py3 asserts due to a bug in SWIG. A fix for this was upstreamed into
24-
# SWIG 3.0.8.
25-
@skipIf(py_version=[">=", (3, 0)], swig_version=["<", (3, 0, 8)])
2623
def test(self):
2724
"""Exercise SBValue API linked_list_iter."""
2825
d = {"EXE": self.exe_name}

0 commit comments

Comments
 (0)