]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
build: Add some debugging messages 45658/head
authorDavid Galloway <dgallowa@redhat.com>
Fri, 25 Mar 2022 21:29:44 +0000 (17:29 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Fri, 1 Apr 2022 17:33:36 +0000 (13:33 -0400)
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 <dgallowa@redhat.com>
install-deps.sh
run-make-check.sh
src/script/run-make.sh

index 4d770c5afb0f64b6106531ee578c7ee448e913c2..90912ac76847e17e02024502c612d1aa2a696529 100755 (executable)
@@ -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 <<EOF
+CI_DEBUG: for_make_check=$for_make_check
+CI_DEBUG: with_seastar=$with_seastar
+CI_DEBUG: with_jaeger=$with_jaeger
+CI_DEBUG: build_profiles=$build_profiles
+CI_DEBUG: Now running 'mk-build-deps' and installing ceph-build-deps package
+EOF
+
        $SUDO env DEBIAN_FRONTEND=noninteractive mk-build-deps \
              --build-profiles "${build_profiles#,}" \
              --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
 
@@ -443,6 +466,7 @@ else
 fi
 
 function populate_wheelhouse() {
+    in_jenkins && echo "CI_DEBUG: Running populate_wheelhouse() in install-deps.sh"
     local install=$1
     shift
 
@@ -460,6 +484,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
 
@@ -475,6 +500,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
@@ -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"
index 71c8afedfdaeb644b9c3d593e5355e571f1ffa72..00adba78c228fc612b62d513f5bd6862d96cc33b 100755 (executable)
@@ -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
index 159766b867ebe1594c994ebe203f5abe02742411..525bde4a74232fb226f001d35877c4b101404e60 100755 (executable)
@@ -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
 }