This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Fix Python 3 lookup when building LLVM with tests
ClosedPublic

Authored by gargaroff on Apr 1 2021, 3:29 AM.

Details

Summary

Remove the find_package(Python3 ...) call from Tooling/CMakeLists.txt as
it would override the python 3 version determined in llvm/CMakeLists.txt.
This call did not respect the LLVM_MINIMUM_PYTHON_VERSION.

This fixes the check-all target when building LLVM on a system where the
default python version is not the minimum required version for running tests.

Diff Detail

Event Timeline

gargaroff created this revision.Apr 1 2021, 3:29 AM
gargaroff requested review of this revision.Apr 1 2021, 3:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2021, 3:29 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
gargaroff added a comment.EditedApr 1 2021, 3:32 AM

Although I find it strange that find_package is called again, even though it is already set through llvm/CMakeLists.txt, this patch does not try to refactor this in any way. The sole purpose is to make tests executable again in our downstream setup.

Did you try just removing that find_package?

Did you try just removing that find_package?

Simply removing it also works. I just wasn't sure whether it might be required by something else, but if not I can go ahead and change this diff to remove it instead.

steveire added a subscriber: steveire.

Yes, please remove the line instead.

gargaroff updated this revision to Diff 335438.Apr 6 2021, 2:13 AM

Remove find_package call from Tooling/CMakeLists.txt

gargaroff retitled this revision from [CMake] Respect LLVM_MINIMUM_PYTHON_VERSION in Tooling/CMakeLists.txt to [CMake] Fix Python 3 lookup when building LLVM with tests.Apr 6 2021, 2:14 AM
gargaroff edited the summary of this revision. (Show Details)
serge-sans-paille accepted this revision.Apr 6 2021, 2:48 AM

LGTM, thanks!

This revision is now accepted and ready to land.Apr 6 2021, 2:48 AM