autobuild: Do not wait when running just one target
[sfrench/samba-autobuild/.git] / script / autobuild.py
index 3b634e86ed630bffec8f9c6d45e0119b5766904c..3c788dd0aea648ee9b72ef9818197d69833a5837 100755 (executable)
@@ -22,7 +22,6 @@ builddirs = {
     "samba-libs"  : ".",
     "ldb"     : "lib/ldb",
     "tdb"     : "lib/tdb",
-    "ntdb"    : "lib/ntdb",
     "talloc"  : "lib/talloc",
     "replace" : "lib/replace",
     "tevent"  : "lib/tevent",
@@ -32,12 +31,11 @@ builddirs = {
     "retry"   : "."
     }
 
-defaulttasks = [ "ctdb", "samba", "samba-ctdb", "samba-libs", "ldb", "tdb", "ntdb", "talloc", "replace", "tevent", "pidl" ]
+defaulttasks = [ "ctdb", "samba", "samba-ctdb", "samba-libs", "ldb", "tdb", "talloc", "replace", "tevent", "pidl" ]
 
 tasks = {
     "ctdb" : [ ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"),
-               ("autogen", "./autogen.sh", "text/plain"),
-               ("configure", "./configure ${PREFIX} --enable-socket-wrapper ", "text/plain"),
+               ("configure", "./configure ${PREFIX}", "text/plain"),
                ("make", "make all", "text/plain"),
                ("install", "make install", "text/plain"),
                ("test", "make autotest", "text/plain"),
@@ -45,7 +43,7 @@ tasks = {
                ("clean", "make clean", "text/plain") ],
 
     # We have 'test' before 'install' because, 'test' should work without 'install'
-    "samba" : [ ("configure", "./configure.developer ${PREFIX} ${PERL_VENDOR_LIB} --with-selftest-prefix=./bin/ab", "text/plain"),
+    "samba" : [ ("configure", "./configure.developer --picky-developer ${PREFIX} --with-selftest-prefix=./bin/ab  --with-profiling-data", "text/plain"),
                 ("make", "make -j", "text/plain"),
                 ("test", "make test FAIL_IMMEDIATELY=1", "text/plain"),
                 ("install", "make install", "text/plain"),
@@ -59,18 +57,13 @@ tasks = {
                      ("tdb-make", "cd lib/tdb && make", "text/plain"),
                      ("tdb-install", "cd lib/tdb && make install", "text/plain"),
 
-                     # build and install ctdb:
-                     ("ctdb-autogen", "cd ./ctdb && ./autogen.sh", "text/plain"),
-                     ("ctdb-configure", "cd ./ctdb && ./configure ${PREFIX} --enable-socket-wrapper --with-included-tdb=no", "text/plain"),
-                     ("ctdb-make", "cd ./ctdb && make all", "text/plain"),
-                     ("ctdb-install", "cd ./ctdb && make install", "text/plain"),
-                     ("ctdb-header-ls", "ls ${PREFIX_DIR}/include/ctdb.h", "text/plain"),
 
-                     # build samba with cluster support against this ctdb:
-                     ("samba-configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure.developer ${PREFIX} ${PERL_VENDOR_LIB} --with-selftest-prefix=./bin/ab --with-cluster-support --with-ctdb-dir=${PREFIX_DIR} --bundled-libraries=!tdb", "text/plain"),
+                     # build samba with cluster support (also building ctdb):
+                     ("samba-configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} ./configure.developer --picky-developer ${PREFIX} --with-selftest-prefix=./bin/ab --with-cluster-support --bundled-libraries=!tdb", "text/plain"),
                      ("samba-make", "make", "text/plain"),
                      ("samba-check", "./bin/smbd -b | grep CLUSTER_SUPPORT", "text/plain"),
                      ("samba-install", "make install", "text/plain"),
+                     ("ctdb-check", "test -e ${PREFIX_DIR}/sbin/ctdbd", "text/plain"),
 
                      # clean up:
                      ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"),
@@ -87,10 +80,6 @@ tasks = {
                       ("tdb-make", "cd lib/tdb && make", "text/plain"),
                       ("tdb-install", "cd lib/tdb && make install", "text/plain"),
 
-                      ("ntdb-configure", "cd lib/ntdb && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
-                      ("ntdb-make", "cd lib/ntdb && make", "text/plain"),
-                      ("ntdb-install", "cd lib/ntdb && make install", "text/plain"),
-
                       ("tevent-configure", "cd lib/tevent && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
                       ("tevent-make", "cd lib/tevent && make", "text/plain"),
                       ("tevent-install", "cd lib/tevent && make install", "text/plain"),
@@ -99,7 +88,7 @@ tasks = {
                       ("ldb-make", "cd lib/ldb && make", "text/plain"),
                       ("ldb-install", "cd lib/ldb && make install", "text/plain"),
 
-                      ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=!talloc,!tdb,!pytdb,!ntdb,!pyntdb,!ldb,!pyldb,!tevent,!pytevent --abi-check --enable-debug -C ${PREFIX} ${PERL_VENDOR_LIB}", "text/plain"),
+                      ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=!talloc,!tdb,!pytdb,!ldb,!pyldb,!tevent,!pytevent --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
                       ("make", "make", "text/plain"),
                       ("install", "make install", "text/plain"),
                       ("dist", "make dist", "text/plain")],
@@ -124,16 +113,6 @@ tasks = {
               ("distcheck", "make distcheck", "text/plain"),
               ("clean", "make clean", "text/plain") ],
 
-    "ntdb" : [
-               ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
-               ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
-               ("make", "make", "text/plain"),
-               ("install", "make install", "text/plain"),
-               ("test", "make test", "text/plain"),
-               ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
-               ("distcheck", "make distcheck", "text/plain"),
-               ("clean", "make clean", "text/plain") ],
-
     "talloc" : [
                  ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
                  ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
@@ -218,7 +197,7 @@ class builder(object):
         cleanup_list.append(self.prefix)
         os.makedirs(self.sdir)
         run_cmd("rm -rf %s" % self.sdir)
-        run_cmd("git clone --shared %s %s" % (test_master, self.sdir), dir=test_master, show=True)
+        run_cmd("git clone --recursive --shared %s %s" % (test_master, self.sdir), dir=test_master, show=True)
         self.start_next()
 
     def start_next(self):
@@ -230,9 +209,6 @@ class builder(object):
         self.cmd = self.cmd.replace("${PYTHON_PREFIX}", get_python_lib(standard_lib=1, prefix=self.prefix))
         self.cmd = self.cmd.replace("${PREFIX}", "--prefix=%s" % self.prefix)
         self.cmd = self.cmd.replace("${PREFIX_DIR}", "%s" % self.prefix)
-        perl_vendor_lib = "--with-perl-arch-install-dir=%s/share/perl5 " % self.prefix
-        perl_vendor_lib += "--with-perl-lib-install-dir=%s/lib/perl5" % self.prefix
-        self.cmd = self.cmd.replace("${PERL_VENDOR_LIB}", perl_vendor_lib)
 #        if self.output_mime_type == "text/x-subunit":
 #            self.cmd += " | %s --immediate" % (os.path.join(os.path.dirname(__file__), "selftest/format-subunit"))
         print '%s: [%s] Running %s' % (self.name, self.stage, self.cmd)
@@ -254,6 +230,11 @@ class buildlist(object):
         self.retry = None
         if tasknames == []:
             tasknames = defaulttasks
+        else:
+            # If we are only running one test,
+            # do not sleep randomly to wait for it to start
+            os.environ['AUTOBUILD_RANDOM_SLEEP_OVERRIDE'] = '1'
+
         for n in tasknames:
             b = builder(n, tasks[n])
             self.tlist.append(b)
@@ -599,7 +580,7 @@ while True:
     try:
         run_cmd("rm -rf %s" % test_master)
         cleanup_list.append(test_master)
-        run_cmd("git clone --shared %s %s" % (gitroot, test_master), show=True, dir=gitroot)
+        run_cmd("git clone --recursive --shared %s %s" % (gitroot, test_master), show=True, dir=gitroot)
     except Exception:
         cleanup()
         raise