now that samba_3_waf is just a regular part of the build, remove seperate tree
[build-farm.git] / build_test.fns
index b7649bde3db5bbfd80774fe7ebc21ccba4831a39..b5ab052e180164e4d010fbccebd1bbc5af297fea 100644 (file)
@@ -164,7 +164,7 @@ choose_scm() {
        tree=$1
 
        case "$tree" in
-                       samba* | rsync | libreplace | talloc | tdb | ldb | pidl | ccache*)
+                       samba* | rsync | libreplace | talloc | tdb | ldb | pidl | ccache* | waf*)
                        echo "git"
                                return 0
                        ;;
@@ -237,35 +237,51 @@ unlock_file() {
 ############################
 
 do_make() {
-       if [ x"$MAKE" = x ]; then
-               MAKE=make
-       fi
+        # work out correct make command
+       case "$tree" in
+           waf*)
+               MAKECOMMAND="./waf"
+               ;;
+           *)
+               MAKECOMMAND="$MAKE"
+               if [ x"$MAKECOMMAND" = x ]; then
+                   MAKECOMMAND=make
+               fi
+               ;;
+       esac
 
        MMTIME=$MAXTIME
        # some trees don't need as much time
        case "$tree" in
-               rsync | tdb | talloc | libreplace | ccache*)
+               rsync | tdb | talloc | libreplace | ccache* | waf*)
                        if [ "$compiler" != "checker" ]; then
                                MMTIME=`expr $MMTIME / 5`
                        fi
                ;;
        esac
 
+       # special build for some trees
+       case "$tree" in
+           waf*)
+               ./waf distclean && ./waf configure build
+               ;;
+       esac
+
 
        for t in $*; do
                if [ x"$BUILD_FARM_NUM_JOBS" = x ]; then
-                       echo "$MAKE $t"
-                       $builddir/timelimit $MMTIME "$MAKE" "$t"
+                       echo "$MAKECOMMAND $t"
+                       $builddir/timelimit $MMTIME "$MAKECOMMAND" "$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"
-                               $builddir/timelimit $MMTIME "$MAKE" "-j$BUILD_FARM_NUM_JOBS"  "$t"
+                               echo "$MAKECOMMAND" "-j$BUILD_FARM_NUM_JOBS"  "$t"
+                               $builddir/timelimit $MMTIME "$MAKECOMMAND" "-j$BUILD_FARM_NUM_JOBS"  "$t"
                                status=$?
                        else
-                               echo "$MAKE $t"
-                               $builddir/timelimit $MMTIME "$MAKE" "$t"
+                               echo "$MAKECOMMAND $t"
+                               $builddir/timelimit $MMTIME "$MAKECOMMAND" "$t"
                                status=$?
                        fi
                fi
@@ -276,7 +292,7 @@ do_make() {
                                        ;;
                                *)
                                        #run again with V=1, so we see failed commands
-                                       $builddir/timelimit $MMTIME "$MAKE" "$t" V=1
+                                       $builddir/timelimit $MMTIME "$MAKECOMMAND" "$t" V=1
                                        status=$?
                                        ;;
                        esac
@@ -329,6 +345,15 @@ action_lcovreport() {
 ############################
 
 action_configure() {
+        # special handling for some trees
+       case "$tree" in
+           waf*)
+               $builddir/timelimit $MAXTIME ./waf configure
+               cstatus=$?
+               echo "CONFIGURE STATUS: $cstatus"
+               return $cstatus
+               ;;
+       esac
 
        if [ ! -x $srcdir/configure -a -r $srcdir/Makefile.PL ]; then
                perl $srcdir/Makefile.PL PREFIX="$prefix"
@@ -392,7 +417,7 @@ action_config_log() {
 ############################
 
 action_config_header() {
-       hdr_files="config.h include/config.h bin/default/config.h bin/default/source4/include/config.h bin/default/source3/include/config.h"
+       hdr_files="config.h include/config.h include/autoconf/config.h bin/default/config.h bin/default/include/config.h bin/default/source3/include/config.h"
        for h in $hdr_files; do
                if [ -f $h ]; then
                        echo "contents of $h:"
@@ -419,6 +444,10 @@ action_build() {
                do_make everything torture
                bstatus=$?
                ;;
+       waf*)
+               do_make build
+               bstatus=$?
+               ;;
        *)
                do_make all
                bstatus=$?
@@ -626,30 +655,36 @@ test_tree() {
                return
        }
 
-       if [ ! -x $srcdir/configure ] && [ "$tree" != "pidl" ]; then
-               echo "skip: $tree.$compiler configure not present, try again next time!"
-               cd $test_root
-               unlock_file "$lck"
-               return
-       fi
+       # check for essential files
+       case "$tree" in
+           pidl)
+               # no generated files
+               ;;
+           waf*)
+               if [ ! -x $srcdir/waf ]; then
+                   echo "skip: $tree.$compiler waf not present, try again next time!"
+                   cd $test_root
+                   unlock_file "$lck"
+                   return
+               fi
+               ;;
+           *)
+               if [ ! -x $srcdir/configure ]; then
+                   echo "skip: $tree.$compiler configure not present, try again next time!"
+                   cd $test_root
+                   unlock_file "$lck"
+                   return
+               fi
+               ;;
+       esac
 
        echo "Starting build of $tree.$compiler in process $$ at `date`"
 
 
        # Parameters for the build depending on the tree
        case "$tree" in
-               libreplace)
-                       builddir="$test_root/tmp.$tree.$compiler"
-                       usingtmpbuild=1
-                       if [ -d $builddir ]; then
-                               rm -rf $builddir
-                       fi
-                       mkdir -p $builddir
-                       export builddir
-                       ;;
                *)
                        builddir=$srcdir
-                       usingtmpbuild=0
                        export builddir
                        ;;
        esac
@@ -864,13 +899,6 @@ test_tree() {
        cd $test_root
 
        /bin/rm -rf $prefix
-       if [ "$usingtmpbuild" = "1" ]; then
-               if [ "$noclean" = "yes" ]; then
-                       echo builddir cleanup skipped!
-               else
-                       /bin/rm -rf $builddir
-               fi
-       fi
        # send the logs to the master site
        send_logs "$log" "$err"
 
@@ -928,7 +956,7 @@ per_run_hook() {
 
        old_trees="web popt distcc samba-gtk smb-build lorikeet-heimdal samba_3_2"
        old_trees="$old_tree samba_3_2_test samba4 samba_4_0_waf samba_4_0_waf.metze"
-       old_trees="$old_tree samba_3_X_test samba_3_X_devel samba_3_X_devel"
+       old_trees="$old_tree samba_3_X_test samba_3_X_devel samba_3_X_devel samba_3_waf"
        for d in $old_trees; do
                delete_old_tree $d
        done