cmake finishes OK for all the projects except debuginfo-tests.

cmake -G Ninja -DLLVM_ENABLE_PROJECTS=“debuginfo-tests” -DLLVM_USE_LINKER=lld -DCMAKE_BUILD_TYPE=“Release” -DLLVM_TARGETS_TO_BUILD=X86 -Wno-dev …/llvm &> …/…/cmake.log

in cmake.log
– Targeting X86
CMake Error at /home/nnelson/Documents/llvm-project/debuginfo-tests/CMakeLists.txt:30 (message):
Cannot run debuginfo-tests without python 3

installed
python3 --version
Python 3.7.5

python --version
Python 2.7.17

in llvm-project/debuginfo-tests/CMakeLists.txt
elseif(PYTHON_VERSION_MAJOR LESS 3)
message(FATAL_ERROR “Cannot run debuginfo-tests without python 3”)

Neil Nelson

Hi Neil,

CMake is using whatever “python” is, which is Python2 for me so I get the same error.

You can specify the Python exe directly[0] by adding this:
-DPYTHON_EXECUTABLE=which python3

That gets you to:

CMake Error at /work/open_source/llvm-project/llvm/cmake/modules/AddLLVM.cmake:1543 (add_dependencies):
The dependency target “clang” of target “check-debuginfo” does not exist.

To fix that you can just add “clang” to LLVM_ENABLE_PROJECTS.

There is a specific FindPython3 module [1] that debuginfo-tests could use but I’m not sure if it’s available in the minimum CMake version we require.

Thanks,
David Spickett.

[0] https://cmake.org/cmake/help/v3.0/module/FindPythonInterp.html
[1] https://cmake.org/cmake/help/v3.12/module/FindPython3.html

Could one of you please file a bug? and mention the helpful references. We’d really like this experience to be smooth, and debuginfo-tests as it exists really supports only Python 3.

Thanks,

–paulr

Raised https://bugs.llvm.org/show_bug.cgi?id=44961