Skip to content

Commit

Permalink
build/ops: do_cmake.sh: automate py3 build options for certain distros
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
smithfarm committed Nov 21, 2018
1 parent 11c61fc commit a691122
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
22 changes: 22 additions & 0 deletions do_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 0 additions & 3 deletions run-make-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a691122

Please sign in to comment.