Bug #41676
build failed with option "-DWITH_TESTS=off
0%
Related issues
History
#1 Updated by Ilsoo Byun over 4 years ago
build as follows:
./do_cmake.sh -DWITH_TESTS=off
cd build
make -j
failed with the following message:
/tmp/ceph/src/mgr/PyModuleRegistry.cc: In member function ‘void PyModuleRegistry::init()’:
/tmp/ceph/src/mgr/PyModuleRegistry.cc:47:39: error: ‘PYTHON_EXECUTABLE’ was not declared in this scope
Py_SetProgramName(const_cast<char*>(PYTHON_EXECUTABLE));
^~~~~~~~~~~~~~~~~
/tmp/ceph/src/mgr/PyModuleRegistry.cc:47:39: note: suggested alternative: ‘MAP_EXECUTABLE’
Py_SetProgramName(const_cast<char*>(PYTHON_EXECUTABLE));
^~~~~~~~~~~~~~~~~
MAP_EXECUTABLE
#2 Updated by Ilsoo Byun over 4 years ago
The reason is that cmake 'FindPython' module doesn't set PYTHON_EXECUTABLE variable but Python_EXECUTABLE(cmake var is case-sensitive)
When exeucuting cmake with option "-WITH-TESTS=on", 'PythonInterp' moudule is imported in googletest. 'PythonInterp' module set PYTHON_EXECUTABLE variable, so no compilation problem.
But with an option 'WITH-TESTS=off', PYTHON_EXECUTABLE var doesn't exists, so compilation failed.
#3 Updated by Ilsoo Byun over 4 years ago
Ilsoo Byun wrote:
The reason is that cmake 'FindPython' module doesn't set PYTHON_EXECUTABLE variable but Python_EXECUTABLE(cmake var is case-sensitive)
When exeucuting cmake with option "-WITH-TESTS=on", 'PythonInterp' moudule is imported in googletest. 'PythonInterp' module set PYTHON_EXECUTABLE variable, so no compilation problem.
But with an option 'WITH-TESTS=off', PYTHON_EXECUTABLE var doesn't exists, so compilation failed.
If PYTHONE_EXECUTABLE is not set, the following line is converted to "/* #undef PYTHON_EXECUTABLE */"
#cmakedefine PYTHON_EXECUTABLE "@MGR_PYTHON_EXECUTABLE@" (src/include/config-h.in.cmake:328)
#4 Updated by Kefu Chai over 4 years ago
- Project changed from devops to mgr
- Status changed from New to Fix Under Review
- Assignee set to Ilsoo Byun
- Pull request ID set to 30199
#5 Updated by Kefu Chai over 4 years ago
- Status changed from Fix Under Review to Resolved
#6 Updated by Nathan Cutler over 4 years ago
- Status changed from Resolved to Pending Backport
- Backport set to mimic, nautilus
I think this was caused by commit 9e45edaab20793c5da8613a881ac24b492006012 "cmake: build ceph-mgr with specified version of python"
$ git branch --contains 9e45edaab20793c5da8613a881ac24b492006012 ... mimic nautilus ...
#7 Updated by Nathan Cutler over 4 years ago
- Copied to Backport #41723: mimic: build failed with option "-DWITH_TESTS=off added
#8 Updated by Nathan Cutler over 4 years ago
- Copied to Backport #41724: nautilus: build failed with option "-DWITH_TESTS=off added
#9 Updated by Nathan Cutler over 4 years ago
- Status changed from Pending Backport to Resolved
While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".