autobuild: Use cp --recursive --link --archive
authorAndrew Bartlett <abartlet@samba.org>
Mon, 4 Jan 2016 01:20:54 +0000 (14:20 +1300)
committerStefan Metzmacher <metze@samba.org>
Tue, 5 Jan 2016 08:10:24 +0000 (09:10 +0100)
This works on waf based builds as source files are not modified during the build

TODO: In order to make sure build doesn't influence each other,
we need to add something like:

         try:
             if options.rebase is not None:
                 rebase_tree(options.rebase, rebase_branch=options.branch)
+            run_cmd("find -type f | xargs chmod -w", show=True, dir=test_master)
         except Exception:

But that means we need to change the way 'make distcheck' works for the
standalone libraries.

For now this will help to reduce the (mem)disk usage of an autobuild a lot.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
script/autobuild.py

index 8d1060e9115fb808d22ddb543f8ebd1ddbd109b0..952bbb58e705d506799998293b040aef344b9750 100755 (executable)
@@ -220,7 +220,7 @@ def run_cmd(cmd, dir=".", show=None, output=False, checkfail=True):
 class builder(object):
     '''handle build of one directory'''
 
-    def __init__(self, name, sequence):
+    def __init__(self, name, sequence, cp=True):
         self.name = name
         self.dir = builddirs[name]
 
@@ -243,7 +243,10 @@ class builder(object):
         cleanup_list.append(self.prefix)
         os.makedirs(self.sdir)
         run_cmd("rm -rf %s" % self.sdir)
-        run_cmd("git clone --recursive --shared %s %s" % (test_master, self.sdir), dir=test_master, show=True)
+        if cp:
+            run_cmd("cp --recursive --link --archive %s %s" % (test_master, self.sdir), dir=test_master, show=True)
+        else:
+            run_cmd("git clone --recursive --shared %s %s" % (test_master, self.sdir), dir=test_master, show=True)
         self.start_next()
 
     def start_next(self):
@@ -282,7 +285,7 @@ class buildlist(object):
             os.environ['AUTOBUILD_RANDOM_SLEEP_OVERRIDE'] = '1'
 
         for n in tasknames:
-            b = builder(n, tasks[n])
+            b = builder(n, tasks[n], cp=n is not "pidl")
             self.tlist.append(b)
         if options.retry:
             rebase_remote = "rebaseon"
@@ -306,7 +309,7 @@ class buildlist(object):
                            ),
                            "test/plain" ) ]
 
-            self.retry = builder('retry', retry_task)
+            self.retry = builder('retry', retry_task, cp=False)
             self.need_retry = False
 
     def kill_kids(self):