]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: use python2 by default
authorKefu Chai <kchai@redhat.com>
Mon, 22 Jul 2019 02:04:58 +0000 (10:04 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 22 Jul 2019 08:07:56 +0000 (16:07 +0800)
and s/PYTHON_EXECUTABLE/Python_EXECUTABLE/

it's a regression introduced by 5e2bd7fc4dd6d137cf67336d568da5b0d568efca

Signed-off-by: Kefu Chai <kchai@redhat.com>
CMakeLists.txt
cmake/modules/AddCephTest.cmake
src/CMakeLists.txt
src/ceph-crash.in
src/ceph.in

index 5df2dc47eb2ea2cdcadac4edfe4237dba2c96148..b533465b9c9968c4732151b5c9956570b2f0237b 100644 (file)
@@ -497,7 +497,7 @@ option(WITH_CEPHFS "CephFS is enabled" ON)
 option(WITH_MGR "ceph-mgr is enabled" ON)
 if(WITH_MGR)
   # Please specify 3 or 3.[0-7] if you want to build with python3 support.
-  # FindPyhonInterp and FindPythonLibs think they belong to different families.
+  # FindPython thinks they belong to different families.
   set(MGR_PYTHON_VERSION "2.7" CACHE
     STRING "minimal required version of python runtime for running mgr plugins. ")
   find_package(Python ${MGR_PYTHON_VERSION} REQUIRED
index 8022dbb1d061e7bda4145aeee68d1dfca8cc57eb..9d92ec54f34e8df3bbf7f2375665fc41f8d1bebc 100644 (file)
@@ -37,7 +37,7 @@ if(WITH_GTEST_PARALLEL)
   add_dependencies(tests gtest-parallel_ext)
   find_package(Python REQUIRED)
   set(GTEST_PARALLEL_COMMAND
-    ${PYTHON_EXECUTABLE} ${gtest_parallel_source_dir}/gtest-parallel)
+    ${Python_EXECUTABLE} ${gtest_parallel_source_dir}/gtest-parallel)
 endif()
 
 #sets uniform compiler flags and link libraries
index c89b05c5106ca32a76b0ca3cd8bb0440dea6188b..d1334bda844f17caf8ab11c2f315496211ca943b 100644 (file)
@@ -251,6 +251,17 @@ if(WITH_PYTHON2)
 else()
   set(PY_BINDING_INFIX 3)
 endif()
+# use python2 by default for python bindings, tools and tests, before
+# switching to python3
+# Python_EXECUTABLE` can be set by `find_package(Python ...)` also. and we do
+# call `find_package(Python ...)` in `ceph/CMakeLists.txt`. but we do so before
+# `add_subdirectory(src)` where `Python_EXECUTABLE` is set. so it's safe to
+# use this variable name and call `find_package(Python ...)`.
+if(WITH_PYTHON2)
+  set(Python_EXECUTABLE ${Python2_EXECUTABLE})
+else()
+  set(Python_EXECUTABLE ${Python3_EXECUTABLE})
+endif()
 
 # sort out which allocator to use
 if(ALLOCATOR STREQUAL "tcmalloc")
index 5bfb50c474b87050e5b314e396811bda2e242e50..676f767eea704eb6d98bc16fa7fc56bc4692b52b 100755 (executable)
@@ -1,4 +1,4 @@
-#!@PYTHON_EXECUTABLE@
+#!@Python_EXECUTABLE@
 # -*- mode:python -*-
 # vim: ts=4 sw=4 smarttab expandtab
 
index 78529616820ddcbb8e27d1f5fcbb734922b18f39..6086c432d6d16a8a32870caf70ab40245c36fc3e 100755 (executable)
@@ -1,4 +1,4 @@
-#!@PYTHON_EXECUTABLE@
+#!@Python_EXECUTABLE@
 # -*- mode:python -*-
 # vim: ts=4 sw=4 smarttab expandtab
 #
@@ -66,7 +66,7 @@ DEVMODEMSG = '*** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH *
 def respawn_in_path(lib_path, pybind_path, pythonlib_path, asan_lib_path):
     execv_cmd = []
     if 'CEPH_DBG' in os.environ:
-        execv_cmd += ['@PYTHON_EXECUTABLE@', '-mpdb']
+        execv_cmd += ['@Python_EXECUTABLE@', '-mpdb']
 
     if platform.system() == "Darwin":
         lib_path_var = "DYLD_LIBRARY_PATH"