[lldb-dev] Swig/Python version incompatibility

Adrian McCarthy via lldb-dev lldb-dev at lists.llvm.org
Mon Jun 24 16:05:54 PDT 2019

tl;dr:  To avoid a compatibility problem with Swig, don't upgrade to Python

While chasing down the cause of lots of lldb test failures on Windows, I
discovered that there's a compatibility bug with Python 3.7 and Swig 3.0.12.

Python 3.7 tighted up the tp_new API, which SWIG generates calls to.
Specifically, you can see assertion failures for "PyTuple_Check(args)" for
pretty much any invocation of the SBAPI.  (This appears only if you're
using a debug version of Python, because the assertion is in the Python

Swig 4.0 has a fix to satisfy Python's tighter expectation, so I upgraded
to Swig 4.0, but then other problems surfaced (like undefined references to

Some context:  https://github.com/swig/swig/issues/1321

So, for now, it looks like we have to stick with Python 3.6/Swig 3.0.12.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20190624/86a40039/attachment.html>

More information about the lldb-dev mailing list