add some more discontinued build trees
[build-farm.git] / build_test.fns
index e8134205018a8e2d7a4ae78577abd8f185468ab5..33f22ab5ca7e20c2c3b4f04bfd1f7a0c1b6e244a 100644 (file)
@@ -141,7 +141,7 @@ choose_scm() {
        tree=$1
 
        case "$tree" in
-               samba* | rsync | libreplace | talloc | tdb | ldb | pidl | ccache)
+               samba* | rsync | libreplace | talloc | tdb | ldb | pidl | ccache*)
                        echo "git"
                        return 0
                ;;
@@ -214,7 +214,7 @@ do_make() {
   MMTIME=$MAXTIME
   # some trees don't need as much time
   case "$tree" in
-       rsync | tdb | talloc | libreplace | ccache)
+       rsync | tdb | talloc | libreplace | ccache*)
          if [ "$compiler" != "checker" ]; then
              MMTIME=`expr $MMTIME / 5`
          fi
@@ -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
@@ -252,6 +264,12 @@ do_make() {
 ############################
 # configure the tree
 action_configure() {
+       if [ ! -x $srcdir/configure -a -r $srcdir/Makefile.PL ]; then
+               perl $srcdir/Makefile.PL PREFIX="$prefix"
+               cstatus=$?
+               echo "CONFIGURE STATUS: $cstatus"
+               return $cstatus;
+       fi
         if [ ! -x $srcdir/configure ]; then
            ls -l $srcdir/configure
            echo "$srcdir/configure is missing"
@@ -264,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
@@ -297,7 +315,7 @@ action_config_log() {
 ############################
 # show the config.h
 action_config_header() {
-    hdr_files="config.h include/config.h bin/default/source4/include/config.h bin/default/source3/include/config.h"
+    hdr_files="config.h include/config.h bin/default/config.h bin/default/source4/include/config.h bin/default/source3/include/config.h"
     for h in $hdr_files; do
        if [ -f $h ]; then
            echo "contents of $h:"
@@ -311,87 +329,12 @@ action_config_header() {
 copy_dir() {
        Tsrc=$1
        Tdst=$2
-       rsync -a --delete $Tsrc/ $Tdst
-}
-
-s4selftest_create() {
-       lock_file "s4selftest.lck" || {
-               return 1;
-       }
-
-       rm -rf $s4selftest/
-       mkdir -p $s4selftest/source
-
-       # we currently only need smbtorture
-       mkdir -p $s4selftest/source/bin
-       rsync -a $builddir/bin/smbtorture $s4selftest/source/bin/smbtorture || {
-               rm -rf $s4selftest/;
-               unlock_file "s4selftest.lck";
-               return 1;
-       }
-
-       unlock_file "s4selftest.lck"
-       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"
+       pwd
+       echo rsync -a --delete $Tsrc/ $Tdst
+       rsync -a --delete $Tsrc/ $Tdst || return 1
+       return 0
 }
 
-s4selftest_update() {
-       lock_file "s4selftest.lck" || {
-               return 1;
-       }
-
-       echo tmp.$tree.$compiler.$$ >tmp.dirname
-       tempdir=`cut -b1-32 tmp.dirname`
-       rm -f tmp.dirname
-
-       copy_dir $s4selftest $tempdir || {
-               rm -rf $tempdir;
-               unlock_file "s4selftest.lck";
-               return 1;
-       }
-
-       rm -rf $s4selftest.$tree.$compiler
-       mv $tempdir $s4selftest.$tree.$compiler
-
-       unlock_file "s4selftest.lck"
-}
 
 ############################
 # build the tree
@@ -400,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
@@ -530,7 +457,7 @@ test_tree() {
        shift
        shift
        shift
-       if [ "$compiler" = "gcc" ] && [ "$tree" != "ccache" ] && ccache -V > /dev/null; then
+       if [ "$compiler" = "gcc" ] && [ "$tree" != "ccache" ] && [ "$tree" != "ccache-maint" ] && ccache -V > /dev/null; then
            CCACHE="ccache"
            export CCACHE
        else
@@ -571,13 +498,7 @@ test_tree() {
        # work out what other trees this package depends on
        deptrees=""
        case "$tree" in
-           talloc | tdb)
-               deptrees="libreplace";
-           ;;
-           ldb)
-               deptrees="libreplace talloc tdb";
-           ;;
-               samba-gtk)
+           samba-gtk)
                deptrees="samba_4_0_test"
                ;;
        esac
@@ -623,7 +544,7 @@ test_tree() {
        echo "Starting build of $tree.$compiler in process $$ at `date`"
 
        case "$tree" in
-           ldb | libreplace)
+           libreplace)
                builddir="$test_root/tmp.$tree.$compiler"
                usingtmpbuild=1
                if [ -d $builddir ]; then
@@ -649,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
@@ -669,23 +598,11 @@ 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"
                export PKG_CONFIG_PATH
                ;;
-       ldb)
-               fetch_tree popt
-               ;;
-       talloc)
-               fetch_tree libreplace
-               ;;
        *)
                testsuite=testsuite
                ;;
@@ -753,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`
@@ -783,10 +695,9 @@ test_tree() {
                  fi
                fi
 
-               if [ "$tree" = "pidl" ] 
-               then
-                       cd $builddir
-                       perl ./Makefile.PL "$prefix"
+               if [ -x $builddir/killbysubdir ]; then
+                   echo "$builddir/killbysubdir $builddir in `pwd`"
+                   $builddir/killbysubdir $builddir
                fi
 
                for action in $actions; do
@@ -888,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
 
@@ -908,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.*
 }
 
@@ -921,9 +821,6 @@ per_run_hook() {
        nohost)
            echo "just a placeholder";
            ;;
-       tridge)
-           kill_old_processes
-           ;;
        deckchair)
            rm -f deckchair.fns
            ;;
@@ -933,11 +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_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
 }