From a691122a4e04e5b98d494a71f51fbee1cdc65cc7 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Wed, 21 Nov 2018 16:14:46 +0100 Subject: [PATCH] build/ops: do_cmake.sh: automate py3 build options for certain distros 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 --- do_cmake.sh | 22 ++++++++++++++++++++++ run-make-check.sh | 3 --- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/do_cmake.sh b/do_cmake.sh index 67f22991001..6178c17f1d0 100755 --- a/do_cmake.sh +++ b/do_cmake.sh @@ -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" diff --git a/run-make-check.sh b/run-make-check.sh index a3a50dfd583..aa08cb31d6d 100755 --- a/run-make-check.sh +++ b/run-make-check.sh @@ -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 <