Page MenuHomePhabricator

build: improve python check for Windows
Needs ReviewPublic

Authored by compnerd on Mon, Oct 28, 2:46 PM.

Details

Summary

If we have a new enough CMake, use find_package(Python3). This version is able to check both 32-bit and 64-bit versions and will setup everything properly without the user needing to specify PYTHON_HOME. This enables building lldb's python bindings on Windows under Azure's CI again.

Diff Detail

Event Timeline

compnerd created this revision.Mon, Oct 28, 2:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptMon, Oct 28, 2:46 PM

I proposed this in https://reviews.llvm.org/D64881 and the consensus was that we didn't want to do this.

Also I don't think this should be a Windows-only thing.

The reason for bringing this back up as a Windows specific thing is that currently, there is no good way to build LLDB with python support without having to specify additional details on *just* windows because the windows path is doing something special. This is trying to bring the windows path to parity with the Linux path.

Yeah, I'd still like to avoid having multiple paths for configuring python, as one of them is bound to end up broken sooner or later. However, given that there's already talk about bumping the minimum cmake version, maybe we could do an lldb-specific bump first?

Though I am generally against aggressive version bumps, this python+windows situation is sufficiently messy that I think the bump may be worth it. Given that this code is python3 specific and other platforms still support python2, maybe we can make this bump windows-specific at first, and then extend it to other platforms once we officially stop supporting python2 ?

[+ other windows stakeholders: @amccarth, @ted, @aleksandr.urakov ]

lldb/cmake/modules/LLDBConfig.cmake
225

What if I use a single-config generator and build a release configuration. Is the "development" thingy still required?

compnerd marked an inline comment as done.Tue, Oct 29, 6:51 PM

Yeah, doing an incremental rollout makes sense.

lldb/cmake/modules/LLDBConfig.cmake
225

Yes, it is - the component is the headers for building.

.. Given that this code is python3 specific and other platforms still support python2, maybe we can make this bump windows-specific at first, and then extend it to other platforms once we officially stop supporting python2 ?

Yes, please. It's a mess on Windows, so I'll support a Windows-specific version bump.