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>
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"
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