[lldb-dev] RFC: Eliminate LLDB_DISABLE_PYTHON

Pavel Labath via lldb-dev lldb-dev at lists.llvm.org
Thu Mar 7 11:36:09 PST 2019


On 07/03/2019 19:27, Adrian McCarthy via lldb-dev wrote:
> We have a build option to build LLDB without Python.  This option is 
> automatically set if Cmake can't find or "validate" your Python 
> distribution.
> 
> Since LLDB is rarely built with this option, nobody discovers when this 
> configuration breaks.  For example, if you try it today, you'll get a 
> handful of missing symbol errors because their declarations are #if'ed 
> out but other code still references them.
> 
> I'm proposing eliminating this option and fixing the validation of the 
> Python distribution in LLDBConfig.cmake.
> 
> If you believe LLDB_DISABLE_PYTHON is still useful, please speak up, and 
> I'll instead look at fixing the existing build problems.
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
> 

I think part of the problem is that we have APIs that are #ifdef PYTHON 
even though there seemingly isn't a good reason for it. For example, I 
have no idea why `GetSummaryForType` should be #ifdef PYTHON. I assume 
that has something to do with the fact that python can be one source of 
type summaries, but that doesn't mean the API itself needs to be 
disabled, particularly as we can (and do) write type summary providers in C.

I think that a more worthwhile effort would be to try to cut down on the 
amount of #ifdefed code without actually removing the ability to not use 
python at all.

pl


More information about the lldb-dev mailing list