[lldb-dev] LLDB Windows Python Bindings

Zachary Turner via lldb-dev lldb-dev at lists.llvm.org
Thu Nov 19 10:01:27 PST 2015


+lldb-dev since this could be useful to other people.

I'm actively working on getting Python 3.5 support working.  If you want to
go this route, it will make your life much easier.  But I don't have a
fully passing test suite yet, there are still about 30 failing tests.  So
consider Python 3.5 experimental, and at your own risk.  (Patches welcome!)

If you want to go with Python 2.7 then the test suite should pass fully,
but there are 1-2 flaky timeouts that happen occasionally.  But it is a lot
more work to set up and nobody ever gets it right because it's so
complicated.

So, *for Python 3.5:*
1) You must use Visual Studio 2015.  2013 or earlier will not work.
2) Install Python 3.5 from python.org
3) Run CMake with -DPYTHON_HOME=C:\Python35
4) That's it.  You're done.

You don't need to build your own Python 3.5, which it sounds like what
you're doing.  If you're not trying to build your own Python 3.5, then
check to make sure your PYTHONPATH is not set to anything.  Mixed
environments could be a problem.  If that doesn't fix it, then debugging
into it a little bit could help.  For example, try running
C:\Python35\python_d.exe and then typing "import _ctypes".  It should
work.  If you're doing a release build then try making sure that
finish_swig is running python.exe, and if you're doing a debug build then
try making sure that finish_swig is running python_d.exe.

*For Python 2.7*
1) You must *not *be using Visual Studio 2015.  Only 2013 will work
2) Can you tell me what command line you're invoking CMake with?
3) Can you open up build.ninja and search for this line:

*Custom command for tools\lldb\CMakeFiles\finish_swig*

And then paste the line under it back into this email?

On Thu, Nov 19, 2015 at 8:55 AM Aidan Dodds <aidan at codeplay.com> wrote:

> Hi Zachary,
>
> I am currently trying to produce a windows build of LLDB that has python
> bindings.
> There seems to be a lot of discussion on the mailing list regarding
> python at the moment.
>
> I couldn't see any documentation or instructions anywhere about how to
> produce them.
>
> I have tried with python2.7 and 3.5 varying degrees of success.
> While I was able to produce a debug version of the 2.7 interpreter,
> CMake seems to be looking for
> python27_d+.lib, and I am not sure why the + has been appended.
> My build using python 3.5 fails on finish_swig, with: ImportError: No
> module named '_ctypes'.
>
> It would be very much appreciated if you could point me to a reference
> for building the bindings
> on windows or even just give me some direction to the simplest way to
> produce them.
>
> Also out of interest what is that state of the lldb test suite on windows?
>
> Thanks,
> Aidan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20151119/07069689/attachment.html>


More information about the lldb-dev mailing list