From: David Galloway Date: Fri, 25 Mar 2022 21:29:44 +0000 (-0400) Subject: build: Add some debugging messages X-Git-Tag: v16.2.8~37^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F45753%2Fhead;p=ceph.git build: Add some debugging messages Having a unique string like "CI_DEBUG" will help me know where we are in the build process in Jenkins logs. Signed-off-by: David Galloway (cherry picked from commit 57edb76ea46893294a70aa080916bc723fb35f9e) --- diff --git a/install-deps.sh b/install-deps.sh index 3ba5e47ff585..cd2138bca7f9 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -23,6 +23,10 @@ export LC_ALL=C # the following is vulnerable to i18n ARCH=$(uname -m) +function in_jenkins() { + test -n "$JENKINS_HOME" +} + function munge_ceph_spec_in { local with_seastar=$1 shift @@ -75,6 +79,7 @@ function munge_debian_control { } function ensure_decent_gcc_on_ubuntu { + in_jenkins && echo "CI_DEBUG: Start ensure_decent_gcc_on_ubuntu() in install-deps.sh" # point gcc to the one offered by g++-7 if the used one is not # new enough local old=$(gcc -dumpfullversion -dumpversion) @@ -133,9 +138,12 @@ ENDOFKEY # cmake uses the latter by default $SUDO ln -nsf /usr/bin/gcc /usr/bin/${ARCH}-linux-gnu-gcc $SUDO ln -nsf /usr/bin/g++ /usr/bin/${ARCH}-linux-gnu-g++ + + in_jenkins && echo "CI_DEBUG: End ensure_decent_gcc_on_ubuntu() in install-deps.sh" } function ensure_python3_sphinx_on_ubuntu { + in_jenkins && echo "CI_DEBUG: Running ensure_python3_sphinx_on_ubuntu() in install-deps.sh" local sphinx_command=/usr/bin/sphinx-build # python-sphinx points $sphinx_command to # ../share/sphinx/scripts/python2/sphinx-build when it's installed @@ -146,6 +154,7 @@ function ensure_python3_sphinx_on_ubuntu { } function install_pkg_on_ubuntu { + in_jenkins && echo "CI_DEBUG: Running install_pkg_on_ubuntu() in install-deps.sh" local project=$1 shift local sha1=$1 @@ -162,6 +171,7 @@ function install_pkg_on_ubuntu { for pkg in $pkgs; do if ! apt -qq list $pkg 2>/dev/null | grep -q installed; then missing_pkgs+=" $pkg" + in_jenkins && echo "CI_DEBUG: missing_pkgs=$missing_pkgs" fi done fi @@ -175,6 +185,7 @@ function install_pkg_on_ubuntu { function install_boost_on_ubuntu { local ver=1.73 + in_jenkins && echo "CI_DEBUG: Running install_boost_on_ubuntu() in install-deps.sh" local installed_ver=$(apt -qq list --installed ceph-libboost*-dev 2>/dev/null | grep -e 'libboost[0-9].[0-9]\+-dev' | cut -d' ' -f2 | @@ -214,6 +225,7 @@ function install_boost_on_ubuntu { } function install_libzbd_on_ubuntu { + in_jenkins && echo "CI_DEBUG: Running install_libzbd_on_ubuntu() in install-deps.sh" local codename=$1 local project=libzbd local sha1=1fadde94b08fab574b17637c2bebd2b1e7f9127b @@ -322,6 +334,7 @@ else fi touch $DIR/status + in_jenkins && echo "CI_DEBUG: Running munge_debian_control() in install-deps.sh" backports="" control=$(munge_debian_control "$VERSION" "$with_seastar" "$for_make_check" "debian/control") case "$VERSION" in @@ -333,7 +346,9 @@ else # make a metapackage that expresses the build dependencies, # install it, rm the .deb; then uninstall the package as its # work is done + in_jenkins && echo "CI_DEBUG: Running mk-build-deps in install-deps.sh" $SUDO env DEBIAN_FRONTEND=noninteractive mk-build-deps --install --remove --tool="apt-get -y --no-install-recommends $backports" $control || exit 1 + in_jenkins && echo "CI_DEBUG: Removing ceph-build-deps" $SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove ceph-build-deps if [ "$control" != "debian/control" ] ; then rm $control; fi ;; @@ -387,6 +402,7 @@ else fi function populate_wheelhouse() { + in_jenkins && echo "CI_DEBUG: Running populate_wheelhouse() in install-deps.sh" local install=$1 shift @@ -401,6 +417,7 @@ function populate_wheelhouse() { } function activate_virtualenv() { + in_jenkins && echo "CI_DEBUG: Running activate_virtualenv() in install-deps.sh" local top_srcdir=$1 local env_dir=$top_srcdir/install-deps-python3 @@ -416,6 +433,7 @@ function activate_virtualenv() { } function preload_wheels_for_tox() { + in_jenkins && echo "CI_DEBUG: Running preload_wheels_for_tox() in install-deps.sh" local ini=$1 shift pushd . > /dev/null @@ -458,3 +476,5 @@ if $for_make_check; then rm -rf $XDG_CACHE_HOME type git > /dev/null || (echo "Dashboard uses git to pull dependencies." ; false) fi + +in_jenkins && echo "CI_DEBUG: End install-deps.sh" diff --git a/run-make-check.sh b/run-make-check.sh index f9fe993381d8..edfe508aa370 100755 --- a/run-make-check.sh +++ b/run-make-check.sh @@ -74,7 +74,10 @@ function main() { if [ $WITH_ZBD ]; then cmake_opts+=" -DWITH_ZBD=ON" fi + in_jenkins && echo "CI_DEBUG: Our cmake_opts are: $cmake_opts + CI_DEBUG: Running ./configure" configure $cmake_opts $@ + in_jenkins && echo "CI_DEBUG: Running 'build tests'" build tests echo "make check: successful build on $(git rev-parse HEAD)" run diff --git a/src/script/run-make.sh b/src/script/run-make.sh index e5fc1a91b05c..f617de7bb23d 100755 --- a/src/script/run-make.sh +++ b/src/script/run-make.sh @@ -7,6 +7,10 @@ trap clean_up_after_myself EXIT ORIGINAL_CCACHE_CONF="$HOME/.ccache/ccache.conf" SAVED_CCACHE_CONF="$HOME/.run-make-check-saved-ccache-conf" +function in_jenkins() { + test -n "$JENKINS_HOME" +} + function save_ccache_conf() { test -f $ORIGINAL_CCACHE_CONF && cp $ORIGINAL_CCACHE_CONF $SAVED_CCACHE_CONF || true } @@ -76,6 +80,7 @@ function prepare() { exit 1 fi if [ -n "$install_cmd" ]; then + in_jenkins && echo "CI_DEBUG: Running '$install_cmd ccache $which_pkg'" $DRY_RUN sudo $install_cmd ccache $which_pkg else echo "WARNING: Don't know how to install packages" >&2 @@ -88,6 +93,7 @@ function prepare() { fi if test -f ./install-deps.sh ; then + in_jenkins && echo "CI_DEBUG: Running install-deps.sh" $DRY_RUN source ./install-deps.sh || return 1 trap clean_up_after_myself EXIT fi @@ -102,7 +108,7 @@ EOM $DRY_RUN export SOURCE_DATE_EPOCH="946684800" $DRY_RUN ccache -o sloppiness=time_macros $DRY_RUN ccache -o run_second_cpp=true - if [ -n "$JENKINS_HOME" ]; then + if in_jenkins; then # Build host has plenty of space available, let's use it to keep # various versions of the built objects. This could increase the cache hit # if the same or similar PRs are running several times @@ -116,6 +122,7 @@ EOM function configure() { local cmake_build_opts=$(detect_ceph_dev_pkgs) + in_jenkins && echo "CI_DEBUG: Running do_cmake.sh" $DRY_RUN ./do_cmake.sh $cmake_build_opts $@ || return 1 } @@ -124,6 +131,7 @@ function build() { $DRY_RUN cd build BUILD_MAKEOPTS=${BUILD_MAKEOPTS:-$DEFAULT_MAKEOPTS} test "$BUILD_MAKEOPTS" && echo "make will run with option(s) $BUILD_MAKEOPTS" + in_jenkins && echo "CI_DEBUG: Running make" $DRY_RUN make $BUILD_MAKEOPTS $targets || return 1 $DRY_RUN ccache -s # print the ccache statistics to evaluate the efficiency }