]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
build/ops: do_cmake.sh: automate py3 build options for certain distros 25205/head
authorNathan Cutler <ncutler@suse.com>
Wed, 21 Nov 2018 15:14:46 +0000 (16:14 +0100)
committerNathan Cutler <ncutler@suse.com>
Wed, 21 Nov 2018 15:51:16 +0000 (16:51 +0100)
Before this patch, run-make-check.sh was setting the cmake options for
py3 build based only on the absence of a python2 binary in the system.
This was not sufficiently deterministic, and it didn't help folks who
run do_cmake.sh directly.

With this patch, we explicitly force the py3 build in do_cmake.sh, for
those OS types/versions we know need it.

Fixes: https://tracker.ceph.com/issues/37330
Signed-off-by: Nathan Cutler <ncutler@suse.com>
do_cmake.sh
run-make-check.sh

index 67f2299100152fb0e9224ca6b0efbb5bfa4075d1..6178c17f1d0925874bbf25fcec71d3d5d3c8739a 100755 (executable)
@@ -5,6 +5,28 @@ if test -e build; then
     exit 1
 fi
 
+PYBUILD="2"
+source /etc/os-release
+case "$ID" in
+    fedora)
+        if [ "$VERSION_ID" -ge "29" ] ; then
+            PYBUILD="3"
+        fi
+        ;;
+    rhel|centos)
+        MAJOR_VER=$(echo "$VERSION_ID" | sed -e 's/\..*$//')
+        if [ "$MAJOR_VER" -ge "8" ] ; then
+            PYBUILD="3"
+        fi
+        ;;
+    opensuse*|suse|sles)
+        PYBUILD="3"
+        ;;
+esac
+if [ "$PYBUILD" = "3" ] ; then
+    ARGS="$ARGS -DWITH_PYTHON2=OFF -DWITH_PYTHON3=ON -DMGR_PYTHON_VERSION=3"
+fi
+
 if type ccache > /dev/null 2>&1 ; then
     echo "enabling ccache"
     ARGS="$ARGS -DWITH_CCACHE=ON"
index a3a50dfd58390da23d6fbfd57c26f486fe2117df..aa08cb31d6d0a806346a5bd8768646142ee0c94e 100755 (executable)
@@ -111,9 +111,6 @@ function run() {
     test "$BUILD_MAKEOPTS" && echo "make will run with option(s) $BUILD_MAKEOPTS"
     CHECK_MAKEOPTS=${CHECK_MAKEOPTS:-$DEFAULT_MAKEOPTS}
     CMAKE_BUILD_OPTS="-DWITH_GTEST_PARALLEL=ON -DWITH_FIO=ON -DWITH_SEASTAR=ON"
-    if ! type python2 > /dev/null 2>&1 ; then
-        CMAKE_BUILD_OPTS+=" -DWITH_PYTHON2=OFF -DWITH_PYTHON3=ON -DMGR_PYTHON_VERSION=3"
-    fi
     CMAKE_BUILD_OPTS+=$(detect_ceph_dev_pkgs)
     cat <<EOM
 Note that the binaries produced by this script do not contain correct time