This is an archive of the discontinued LLVM Phabricator instance.

build: use `find_package(Python3)` if available (llvm runtimes).
Needs ReviewPublic

Authored by vvereschaka on Apr 29 2020, 4:54 PM.

Details

Reviewers
compnerd
phosek
Summary

This is primarily motivated by the desire to move from Python2 to
Python3. PYTHON_EXECUTABLE is ambiguous. This explicitly identifies
the python interpreter in use. Since the LLVM build seems to be able to
completed successfully with python3, use that across the build. The old
path aliases PYTHON_EXECUTABLE to be treated as Python3.

Based on commit cd84bfb8142bc7ff3a07a188ffb809f1d86d1fd7

Diff Detail

Event Timeline

vvereschaka created this revision.Apr 29 2020, 4:54 PM

Hi @compnerd,
here is one more place, which needs a proper detection for Python3/Python2.
I just copied a part of your changes accordingly.

compnerd added inline comments.May 13 2020, 4:33 PM
llvm/runtimes/CMakeLists.txt
118

This was not fatal previously was it? Why make it fatal now?

139

Similar

vvereschaka marked an inline comment as done.May 13 2020, 5:10 PM
vvereschaka added inline comments.
llvm/runtimes/CMakeLists.txt
118

It was fatal in commit https://github.com/llvm/llvm-project/commit/c4c3883b00d3a6aa657a5e3e515c90c9ea1f81c6
I just did copy/paste into a proper location.

compnerd added inline comments.May 15 2020, 2:48 PM
llvm/runtimes/CMakeLists.txt
118

Sure, because those projects used it with a failure being fatal. Here, the check is being performed without it being fatal. Note that there was no check in the CMakeLists.txt which checked if the python interpreter was found. If that exists, we should remove the old check and keep the check here only.