Python scripting in Windows LLDB

Hi!

I’ve just noticed that LLDB from the most recent LLVM Windows snapshot build has Python scripting disabled.
Was this done on purpose and for what reason if so?

Update: looks like Python detection in CMake now requires debug binaries to be there as well (e.g. python35_d.dll), otherwise Python support gets disabled. I am wondering if Python the build machine was installed without the debug stuff.

Hmm, I believe it’s only supposed to do that if you’re doing a debug build. It should only require the Python libraries that match your current build. Is it not doing this?

Yes, my machine doesn't have the _d.dll files.

LLDBConfig.cmake has this:

if (NOT (PYTHON_DEBUG_EXE AND PYTHON_RELEASE_EXE AND PYTHON_DEBUG_LIB AND PYTHON_RELEASE_LIB AND PYTHON_DEBUG_DLL AND PYTHON_RELEASE_DLL))

message(“Python installation is corrupt. Python support will be disabled for this build.”)

set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)

return()

endif()

Internally I’ve changed it to:

if (CMAKE_BUILD_TYPE STREQUAL “Debug”)

if (NOT (PYTHON_DEBUG_EXE AND PYTHON_DEBUG_LIB AND PYTHON_DEBUG_DLL))

message(“Python installation is corrupt. Python support will be disabled for this build.”)

set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)

return()

endif()

else()

if (NOT (PYTHON_RELEASE_EXE AND PYTHON_RELEASE_LIB))

message(“Python installation is corrupt. Python support will be disabled for this build.”)

set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)

return()

endif()

endif()

That works with our buildbots building release.

Note the release check doesn’t check for the DLL – our installations don’t have the release DLL, so I didn’t put that in.

I can push this change upstream if you’d like, Zach.

It would be better if the build fails hard if some dependency isn't
available. I'll never notice a message about Python support being
disabled since there's so much noise in the build anyway.

This may cause some issues with the multi-configuration generators.
E.g. a single VS build will create both debug and release
configurations. I suspect this is the reason why the check is written
as it is now.

I'm not sure what would be the appropriate behavior in this case if
only one of the pythons is available.

My dev machine has both debug and release python exe/lib/dll installed; The VS solution made by cmake works fine building debug and release versions of lldb. Our bots only have release exe/lib, and create a VS solution with cmake and build with msbuild.

Ok, if it works, I'm all for it. I can't say I'm really familiar with
how the multi-configuration generators work.

I also wouldn't mind failing more aggresively if a dependency is not available.