[llvm-bugs] [Bug 44961] New: debug-info tests CMake fails to find python3

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 19 02:55:38 PST 2020


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

            Bug ID: 44961
           Summary: debug-info tests CMake fails to find python3
           Product: Build scripts
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: david.spickett at arm.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 23144
  --> https://bugs.llvm.org/attachment.cgi?id=23144&action=edit
Full cmake output.

When configuring llvm for the "debuginfo-tests" target, it will detect whatever
'python' is in the shell.

$ python
Python 2.7.12 (default, Aug 22 2019, 16:36:40) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
$ cmake -DLLVM_ENABLE_PROJECTS="debuginfo-tests" ../llvm-project/llvm
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- The ASM compiler identification is GNU
<...>
-- Found PythonInterp: /usr/bin/python (found version "2.7.12") 
<...>
CMake Error at /work/open_source/llvm-project/debuginfo-tests/CMakeLists.txt:30
(message):
  Cannot run debuginfo-tests without python 3


-- Configuring incomplete, errors occurred!
See also "/work/open_source/llvm-project-build/CMakeFiles/CMakeOutput.log".
See also "/work/open_source/llvm-project-build/CMakeFiles/CMakeError.log".

(full output attached)

CMake will pass if you add "-DPYTHON_EXECUTABLE=`which python3`".

However once you do that it will fail with:
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.

Adding clang to LLVM_ENABLE_PROJECTS works around that.

CMake is likely using
https://cmake.org/cmake/help/v3.0/module/FindPythonInterp.html to find Python.
In later versions of CMake there is a Python 3 specific version
https://cmake.org/cmake/help/v3.12/module/FindPython3.html.

Unfortunately this was added in CMake 3.12.4 so not available in LLVM's minimum
of 3.4.3.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200219/d9beba8d/attachment.html>


More information about the llvm-bugs mailing list