add some more discontinued build trees
[build-farm.git] / build_test.fns
index 5399de353d265085b75fbdcbebcddf94ae1f63f0..33f22ab5ca7e20c2c3b4f04bfd1f7a0c1b6e244a 100644 (file)
@@ -225,21 +225,33 @@ do_make() {
   for t in $*; do
     if [ x"$BUILD_FARM_NUM_JOBS" = x ]; then
       echo "$MAKE $t"
-      ./timelimit $MMTIME "$MAKE" "$t"
+      $builddir/timelimit $MMTIME "$MAKE" "$t"
       status=$?
     else
       # we can parallelize everything and all targets
       if [ x"$t" = xeverything ] || [ x"$t" = xall]; then
         echo "$MAKE" "-j$BUILD_FARM_NUM_JOBS"  "$t"
-        ./timelimit $MMTIME "$MAKE" "-j$BUILD_FARM_NUM_JOBS"  "$t"
+        $builddir/timelimit $MMTIME "$MAKE" "-j$BUILD_FARM_NUM_JOBS"  "$t"
         status=$?
       else
         echo "$MAKE $t"
-        ./timelimit $MMTIME "$MAKE" "$t"
+        $builddir/timelimit $MMTIME "$MAKE" "$t"
         status=$?
       fi
     fi
 
+    if [ $status != 0 ]; then
+       case "$t" in
+           test | check | installcheck)
+               ;;
+           *)
+               # run again with V=1, so we see failed commands
+               $builddir/timelimit $MMTIME "$MAKE" "$t" V=1
+               status=$?
+               ;;
+       esac
+    fi
+
     if [ $status != 0 ]; then
       return $status;
     fi
@@ -270,7 +282,7 @@ action_configure() {
        echo CC="$CCACHE $compiler" $srcdir/configure $config_and_prefix
        CC="$CCACHE $compiler"
        export CC
-       ./timelimit $MAXTIME $srcdir/configure $config_and_prefix
+       $builddir/timelimit $MAXTIME $srcdir/configure $config_and_prefix
        cstatus=$?
        if [ x"$cstatus" != x"0" ]; then
                if [ -f config.log ]; then
@@ -323,90 +335,6 @@ copy_dir() {
        return 0
 }
 
-s4selftest_create() {
-       lock_file "s4selftest.lck" || {
-           echo "s4selftest_create: already locked"
-           return 1;
-       }
-
-       # we currently only need smbtorture
-       mkdir -p $s4selftest/source/bin
-       echo "s4selftest_create: rsync -aL $builddir/bin/smbtorture.static $s4selftest/source/bin/smbtorture"
-       rsync -aL $builddir/bin/smbtorture.static $s4selftest/source/bin/smbtorture || {
-           echo "s4selftest_create: failed rsync"
-           unlock_file "s4selftest.lck";
-           return 1;
-       }
-
-       unlock_file "s4selftest.lck"
-       echo "s4selftest_create: OK"
-       return 0;
-
-       copy_dir $builddir/bin $s4selftest/source/bin || {
-               rm -rf $s4selftest/;
-               unlock_file "s4selftest.lck";
-               return 1;
-       }
-
-       copy_dir $srcdir/setup $s4selftest/source/setup || {
-               rm -rf $s4selftest/;
-               unlock_file "s4selftest.lck";
-               return 1;
-       }
-
-       copy_dir $srcdir/../testprogs $s4selftest/testprogs || {
-               rm -rf $s4selftest/;
-               unlock_file "s4selftest.lck";
-               return 1;
-       }
-
-       copy_dir $srcdir/selftest $s4selftest/source/selftest || {
-               rm -rf $s4selftest/;
-               unlock_file "s4selftest.lck";
-               return 1;
-       }
-
-       copy_dir $srcdir/script $s4selftest/source/script || {
-               rm -rf $s4selftest/;
-               unlock_file "s4selftest.lck";
-               return 1;
-       }
-
-       mkdir -p $s4selftest/source/scripting || {
-               rm -rf $s4selftest/;
-               unlock_file "s4selftest.lck";
-               return 1;
-       }
-
-       unlock_file "s4selftest.lck"
-}
-
-s4selftest_update() {
-       lock_file "s4selftest.lck" || {
-           echo "s4selftest_update LOCKED"
-           return 1;
-       }
-
-       echo tmp.$tree.$compiler.$$ >tmp.dirname
-       tempdir=`cut -b1-32 tmp.dirname`
-       rm -f tmp.dirname
-
-       echo "COPYING $s4selftest => $tempdir"
-       copy_dir $s4selftest $tempdir || {
-               rm -rf $tempdir;
-               unlock_file "s4selftest.lck";
-               echo "s4selftest_update COPY FAILED"
-               return 1;
-       }
-
-       echo "RENAMING $tempdir $s4selftest.$tree.$compiler"
-       rm -rf $s4selftest.$tree.$compiler
-       mv $tempdir $s4selftest.$tree.$compiler
-
-       unlock_file "s4selftest.lck"
-       echo "s4selftest_update OK"
-       return 0
-}
 
 ############################
 # build the tree
@@ -415,22 +343,6 @@ action_build() {
        samba_4*)
                do_make everything
                bstatus=$?
-               if test x"$bstatus" != x"0"; then
-                       # the 2nd 'make everything' is to work around a bug
-                       # in netbsd make. 
-                       do_make everything
-                       bstatus=$?
-               fi
-
-               if test x"$bstatus" != x"0"; then
-                       do_make testsuite
-                       bstatus=$?
-               fi
-
-               if test x"$bstatus" = x"0"; then
-                       s4selftest_create
-               fi
-
                ;;
        samba_3*)
                do_make everything torture
@@ -658,12 +570,20 @@ test_tree() {
            fi
        fi
 
+        # build the timelimit utility
+       echo "Building timelimit"
+       mkdir -p $builddir
+       echo $compiler $TIMELIMIT_FLAGS -o $builddir/timelimit $test_root/timelimit.c
+       $compiler $TIMELIMIT_FLAGS -o $builddir/timelimit $test_root/timelimit.c || exit 1
+
+        # build the killbysubdir utility
+       echo "Building killbysubdir"
+       echo $compiler -o $builddir/killbysubdir $test_root/killbysubdir.c
+       $compiler -o $builddir/killbysubdir $test_root/killbysubdir.c
+
        prefix="$test_root/prefix/$tree.$compiler"
        mkdir -p "$prefix"
 
-       s4selftest=$test_root/s4selftest
-       export s4selftest
-
        sw_config=$config
 
        case "$tree" in
@@ -678,12 +598,6 @@ test_tree() {
        samba_3*)
                sw_config="$config --enable-socket-wrapper"
                sw_config="$sw_config --enable-nss-wrapper"
-               s4selftest_update "$tree" "$compiler" && {
-                       t="$s4selftest.$tree.$compiler/source"
-                       #sw_config="$sw_config --with-samba4srcdir=$t"
-                       t="$t/bin/smbtorture"
-                       sw_config="$sw_config --with-smbtorture4-path=$t"
-               }
                ;;
        samba-gtk)
                PKG_CONFIG_PATH="$test_root/prefix/samba_4_0_test.$compiler/lib/pkgconfig"
@@ -756,11 +670,6 @@ test_tree() {
                echo "Showing limits"
                ulimit -a 2> /dev/null
 
-               # build the timelimit utility
-               echo "Building timelimit"
-               mkdir -p $builddir
-               $compiler $TIMELIMIT_FLAGS -o $builddir/timelimit $test_root/timelimit.c || exit 1
-
                # the following is for non-samba builds only
                if [ "$scm" = "svn" -a -r $test_root/$tree.svn ]; then
                  h_rev=`grep 'Revision: ' $test_root/$tree.svn | cut -d ':' -f2 | cut -d ' ' -f2 | sed 1q`
@@ -786,6 +695,11 @@ test_tree() {
                  fi
                fi
 
+               if [ -x $builddir/killbysubdir ]; then
+                   echo "$builddir/killbysubdir $builddir in `pwd`"
+                   $builddir/killbysubdir $builddir
+               fi
+
                for action in $actions; do
 
                    echo Running action $action
@@ -885,16 +799,6 @@ global_unlock() {
     unlock_file "global.lck"
 }
 
-#########################################################
-# enable this on a per host basis only when needed please
-# (at least for the moment)
-kill_old_processes() {
-    # this should work on systems with linux like ps
-    (ps uxfw | grep /build | grep -v grep | egrep 'Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec' | awk '{print $2}' | xargs kill -9) 2> /dev/null
-    # and this should work on sysv style ps
-    (ps -fu $USER | grep /build | grep -v grep | egrep 'Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec' | awk '{print $2}' | xargs kill -9) 2> /dev/null
-}
-
 delete_old_tree() {
        otree=$1
 
@@ -905,7 +809,6 @@ delete_old_tree() {
        rm -rf $otree.*.svn
        rm -rf $otree.git
        rm -rf $otree.*.git
-       rm -rf s4selftest.$otree.*
        rm -rf build.$otree.*
 }
 
@@ -918,9 +821,6 @@ per_run_hook() {
        nohost)
            echo "just a placeholder";
            ;;
-       tridge)
-           kill_old_processes
-           ;;
        deckchair)
            rm -f deckchair.fns
            ;;
@@ -930,12 +830,10 @@ per_run_hook() {
        rm -f build.log
     fi
 
-    delete_old_tree "samba_3_2"
-    delete_old_tree "samba_3_2_test"
-    delete_old_tree "samba4"
-    delete_old_tree "samba_4_0_test"
-    delete_old_tree "samba_3_X_test"
-    delete_old_tree "samba_3_X_devel"
+    old_trees="web popt distcc samba-gtk smb-build lorikeet-heimdal samba_3_2 samba_3_2_test samba4 samba_4_0_waf samba_4_0_waf.metze samba_3_X_test samba_3_X_devel samba_3_X_devel"
+    for d in $old_trees; do
+       delete_old_tree $d
+    done
 }