diff --git a/lldb/bindings/python/python.swig b/lldb/bindings/python/python.swig --- a/lldb/bindings/python/python.swig +++ b/lldb/bindings/python/python.swig @@ -52,10 +52,6 @@ # Relative import should work if we are being loaded by Python. from . import $module" %enddef -// These versions will not generate working python modules, so error out early. -#if SWIG_VERSION >= 0x030009 && SWIG_VERSION < 0x030011 -#error Swig versions 3.0.9 and 3.0.10 are incompatible with lldb. -#endif // The name of the module to be created. %module(docstring=DOCSTRING, moduleimport=MODULEIMPORT) lldb diff --git a/lldb/cmake/modules/FindLuaAndSwig.cmake b/lldb/cmake/modules/FindLuaAndSwig.cmake --- a/lldb/cmake/modules/FindLuaAndSwig.cmake +++ b/lldb/cmake/modules/FindLuaAndSwig.cmake @@ -15,7 +15,7 @@ LUA_INCLUDE_DIR) endif() else() - message(STATUS "SWIG 3 or later is required for Lua support in LLDB but could not be found") + message(STATUS "SWIG 4 or later is required for Lua support in LLDB but could not be found") endif() diff --git a/lldb/cmake/modules/FindPythonAndSwig.cmake b/lldb/cmake/modules/FindPythonAndSwig.cmake --- a/lldb/cmake/modules/FindPythonAndSwig.cmake +++ b/lldb/cmake/modules/FindPythonAndSwig.cmake @@ -40,7 +40,7 @@ if (LLDB_ENABLE_SWIG) FindPython3() else() - message(STATUS "SWIG 3 or later is required for Python support in LLDB but could not be found") + message(STATUS "SWIG 4 or later is required for Python support in LLDB but could not be found") endif() get_property(MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -50,7 +50,7 @@ message(STATUS "${description}: ${${variable}}") endmacro() -add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 3) +add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 4) add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND) add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" CursesAndPanel CURSESANDPANEL_FOUND) add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND) diff --git a/lldb/docs/resources/build.rst b/lldb/docs/resources/build.rst --- a/lldb/docs/resources/build.rst +++ b/lldb/docs/resources/build.rst @@ -34,7 +34,7 @@ scripting support. * `Python `_ -* `SWIG `_ 3 or later. +* `SWIG `_ 4 or later. Optional Dependencies ********************* diff --git a/lldb/test/API/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/test/API/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py --- a/lldb/test/API/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py +++ b/lldb/test/API/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py @@ -117,8 +117,6 @@ sb_debugger.fuzz_obj(obj) - # darwin: This test passes with swig 3.0.2, fails w/3.0.5 other tests fail - # with 2.0.12 http://llvm.org/pr23488 def test_SBError(self): obj = lldb.SBError() if self.TraceOn(): @@ -225,9 +223,6 @@ sb_listener.fuzz_obj(obj) - # Py3 asserts due to a bug in SWIG. Trying to upstream a patch to fix - # this in 3.0.8 - @skipIf(py_version=[">=", (3, 0)], swig_version=["<", (3, 0, 8)]) def test_SBModule(self): obj = lldb.SBModule() if self.TraceOn(): diff --git a/lldb/test/API/python_api/lldbutil/TestSwigVersion.py b/lldb/test/API/python_api/lldbutil/TestSwigVersion.py --- a/lldb/test/API/python_api/lldbutil/TestSwigVersion.py +++ b/lldb/test/API/python_api/lldbutil/TestSwigVersion.py @@ -21,6 +21,6 @@ self.assertTrue(getattr(lldb, "swig_version")) self.assertIsInstance(lldb.swig_version, tuple) self.assertEqual(len(lldb.swig_version), 3) - self.assertGreaterEqual(lldb.swig_version[0], 1) + self.assertGreaterEqual(lldb.swig_version[0], 4) for v in lldb.swig_version: self.assertGreaterEqual(v, 0) diff --git a/lldb/test/API/python_api/module_section/TestModuleAndSection.py b/lldb/test/API/python_api/module_section/TestModuleAndSection.py --- a/lldb/test/API/python_api/module_section/TestModuleAndSection.py +++ b/lldb/test/API/python_api/module_section/TestModuleAndSection.py @@ -10,9 +10,6 @@ class ModuleAndSectionAPIsTestCase(TestBase): - # Py3 asserts due to a bug in SWIG. A fix for this was upstreamed into - # SWIG 3.0.8. - @skipIf(py_version=[">=", (3, 0)], swig_version=["<", (3, 0, 8)]) def test_module_and_section(self): """Test module and section APIs.""" self.build() diff --git a/lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py b/lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py --- a/lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py +++ b/lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py @@ -20,9 +20,6 @@ # Find the line number to break at. self.line = line_number("main.cpp", "// Break at this line") - # Py3 asserts due to a bug in SWIG. A fix for this was upstreamed into - # SWIG 3.0.8. - @skipIf(py_version=[">=", (3, 0)], swig_version=["<", (3, 0, 8)]) def test(self): """Exercise SBValue API linked_list_iter.""" d = {"EXE": self.exe_name}