From: David Galloway Date: Fri, 25 Mar 2022 21:29:44 +0000 (-0400) Subject: build: Add some debugging messages X-Git-Tag: v18.0.0~1140^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F45658%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 --- diff --git a/install-deps.sh b/install-deps.sh index 4d770c5afb0f..90912ac76847 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -23,6 +23,10 @@ export LC_ALL=en_US.UTF-8 # 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 @@ -67,6 +71,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) @@ -125,9 +130,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 @@ -138,6 +146,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 @@ -154,6 +163,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 @@ -166,6 +176,7 @@ function install_pkg_on_ubuntu { } function install_boost_on_ubuntu { + in_jenkins && echo "CI_DEBUG: Running install_boost_on_ubuntu() in install-deps.sh" local ver=1.75 local installed_ver=$(apt -qq list --installed ceph-libboost*-dev 2>/dev/null | grep -e 'libboost[0-9].[0-9]\+-dev' | @@ -206,6 +217,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 @@ -218,6 +230,7 @@ function install_libzbd_on_ubuntu { } function install_libpmem_on_ubuntu { + in_jenkins && echo "CI_DEBUG: Running install_libpmem_on_ubuntu() in install-deps.sh" local codename=$1 local project=pmem local sha1=7c18b4b1413ae965ea8bcbfc69eb9784f9212319 @@ -336,6 +349,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" "debian/control") case "$VERSION" in @@ -358,10 +372,19 @@ else build_profiles+=",pkg.ceph.jaeger" fi + in_jenkins && cat < /dev/null @@ -517,3 +543,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 71c8afedfdae..00adba78c228 100755 --- a/run-make-check.sh +++ b/run-make-check.sh @@ -100,7 +100,10 @@ function main() { if [ $WITH_PMEM ]; then cmake_opts+=" -DWITH_RBD_RWL=ON -DWITH_SYSTEM_PMDK=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)" FOR_MAKE_CHECK=1 run diff --git a/src/script/run-make.sh b/src/script/run-make.sh index 159766b867eb..525bde4a7423 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 } @@ -72,6 +76,7 @@ function do_install() { if test $ret -eq 100 ; then # dpkg was interrupted $DRY_RUN sudo dpkg --configure -a + in_jenkins && echo "CI_DEBUG: Running 'sudo $install_cmd $pkgs'" $DRY_RUN sudo $install_cmd $pkgs else return $ret @@ -105,6 +110,7 @@ function prepare() { exit 1 fi if [ -n "$install_cmd" ]; then + in_jenkins && echo "CI_DEBUG: Running '$install_cmd ccache $which_pkg clang'" do_install "$install_cmd" ccache $which_pkg clang else echo "WARNING: Don't know how to install packages" >&2 @@ -117,6 +123,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 @@ -131,7 +138,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 @@ -145,6 +152,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 } @@ -157,6 +165,7 @@ function build() { BUILD_MAKEOPTS=${BUILD_MAKEOPTS:-$DEFAULT_MAKEOPTS} test "$BUILD_MAKEOPTS" && echo "make will run with option(s) $BUILD_MAKEOPTS" # older cmake does not support --parallel or -j, so pass it to underlying generator + in_jenkins && echo "CI_DEBUG: Running cmake" $DRY_RUN cmake --build . $targets -- $BUILD_MAKEOPTS || return 1 $DRY_RUN ccache -s # print the ccache statistics to evaluate the efficiency }