From 88674624175451ae81e31edb6c92d815a3d3fec7 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 21 Oct 2015 14:35:33 +1300 Subject: [PATCH 1/6] autobuild: Give a clearer failure message This helps when autobuild.py is used in --tail mode and where there is neither e-mail nor access to the logs.tar.gz Working back to find where the error happened is typically quite difficult, as many failures are actually due to the cleanup. Signed-off-by: Andrew Bartlett --- script/autobuild.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/script/autobuild.py b/script/autobuild.py index 2d3af2a..7196562 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -720,7 +720,25 @@ def email_success(elapsed_time, log_base=None): if options.email is not None: email_failure(status, failed_task, failed_stage, failed_tag, errstr, elapsed_time, log_base=options.log_base) +else: + elapsed_minutes = elapsed_time / 60.0 + print ''' + +#################################################################### + +AUTOBUILD FAILURE + +Your autobuild on %s failed after %.1f minutes +when trying to test %s with the following error: + + %s + +the autobuild has been abandoned. Please fix the error and resubmit. + +#################################################################### +''' % (platform.node(), elapsed_minutes, failed_task, errstr) + cleanup() print(errstr) print("Logs in logs.tar.gz") From 0535f9f986c044e8fe80b11339ef085738410690 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 22 Oct 2015 10:35:47 +1300 Subject: [PATCH 2/6] Put the static build in another stanza This will allow it to run on a different VM in travis-ci and so keep us below the 50min limit. Because we do not rebuild the libs (and real world static builds are likely to have internal libs), this changes us to build them internally. Signed-off-by: Andrew Bartlett --- script/autobuild.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/script/autobuild.py b/script/autobuild.py index 7196562..7ef7880 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -26,6 +26,7 @@ "samba-xc" : ".", "samba-ctdb" : ".", "samba-libs" : ".", + "samba-static" : ".", "ldb" : "lib/ldb", "tdb" : "lib/tdb", "talloc" : "lib/talloc", @@ -37,7 +38,7 @@ "retry" : "." } -defaulttasks = [ "ctdb", "samba", "samba-xc", "samba-ctdb", "samba-libs", "ldb", "tdb", "talloc", "replace", "tevent", "pidl" ] +defaulttasks = [ "ctdb", "samba", "samba-xc", "samba-ctdb", "samba-libs", "samba-static", "ldb", "tdb", "talloc", "replace", "tevent", "pidl" ] samba_configure_params = " --picky-developer ${PREFIX} --with-profiling-data" @@ -121,21 +122,22 @@ # retry with all modules shared ("allshared-distclean", "make distclean", "text/plain"), ("allshared-configure", samba_libs_configure_samba + " --with-shared-modules=ALL", "text/plain"), - ("allshared-make", "make", "text/plain"), + ("allshared-make", "make", "text/plain")], - # retry with all modules static - ("allstatic-distclean", "make distclean", "text/plain"), - ("allstatic-configure", samba_libs_configure_samba + " --with-static-modules=ALL", "text/plain"), + "samba-static" : [ + ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), + # build with all modules static + ("allstatic-configure", "./configure.developer " + samba_configure_params + " --with-static-modules=ALL", "text/plain"), ("allstatic-make", "make", "text/plain"), # retry without any required modules ("none-distclean", "make distclean", "text/plain"), - ("none-configure", samba_libs_configure_samba + " --with-static-modules=!FORCED,!DEFAULT --with-shared-modules=!FORCED,!DEFAULT", "text/plain"), + ("none-configure", "./configure.developer " + samba_configure_params + " --with-static-modules=!FORCED,!DEFAULT --with-shared-modules=!FORCED,!DEFAULT", "text/plain"), ("none-make", "make", "text/plain"), # retry with nonshared smbd and smbtorture ("nonshared-distclean", "make distclean", "text/plain"), - ("nonshared-configure", samba_libs_configure_base + " --bundled-libraries=talloc,tdb,pytdb,ldb,pyldb,tevent,pytevent --with-static-modules=ALL --nonshared-binary=smbtorture,smbd/smbd", "text/plain"), + ("nonshared-configure", "./configure.developer " + samba_configure_params + " --bundled-libraries=talloc,tdb,pytdb,ldb,pyldb,tevent,pytevent --with-static-modules=ALL --nonshared-binary=smbtorture,smbd/smbd", "text/plain"), ("nonshared-make", "make", "text/plain")], "ldb" : [ From c8d51f36f197eea6159c58f6aeac0e914edd7bc1 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 4 May 2015 13:44:45 +1200 Subject: [PATCH 3/6] Add metadata file for the Travis CI Open Source cloud build/test service Signed-off-by: Andrew Bartlett --- .travis.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ea60918 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +language: c +dist: trusty + +sudo: true + +cache: ccache + +# Everything except samba and ctdb (long tests) +env: + - TASK=samba-xc + - TASK=samba-ctdb + - TASK=samba-libs + - TASK=samba-static + - TASK=ldb + - TASK=tdb + - TASK=talloc + - TASK=replace + - TASK=tevent + - TASK=pidl + +before_install: + - sudo apt-get update -qq + - sudo apt-get install --assume-yes screen git build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev libpam0g-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev acl bison debhelper docbook-xml docbook-xsl flex libaio-dev libbsd-dev libcap-dev libcups2-dev libncurses5-dev libpam0g-dev libpopt-dev libreadline-dev perl perl-modules libparse-yapp-perl pkg-config python-all-dev python-dnspython xsltproc zlib1g-dev autoconf + +script: + - git fetch --unshallow + - ./script/autobuild.py --tail --testbase=/tmp $TASK + From 4b68462cd8525f73dc76d1b7e65d651f0f9e7d21 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 22 Oct 2015 14:57:10 +1300 Subject: [PATCH 4/6] autobuild: Use make -j on samba-libs build as well We need this build to be fast when split out as a seperate VM Signed-off-by: Andrew Bartlett --- script/autobuild.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/autobuild.py b/script/autobuild.py index 7ef7880..16ea43f 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -122,23 +122,23 @@ # retry with all modules shared ("allshared-distclean", "make distclean", "text/plain"), ("allshared-configure", samba_libs_configure_samba + " --with-shared-modules=ALL", "text/plain"), - ("allshared-make", "make", "text/plain")], + ("allshared-make", "make -j", "text/plain")], "samba-static" : [ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), # build with all modules static ("allstatic-configure", "./configure.developer " + samba_configure_params + " --with-static-modules=ALL", "text/plain"), - ("allstatic-make", "make", "text/plain"), + ("allstatic-make", "make -j", "text/plain"), # retry without any required modules ("none-distclean", "make distclean", "text/plain"), ("none-configure", "./configure.developer " + samba_configure_params + " --with-static-modules=!FORCED,!DEFAULT --with-shared-modules=!FORCED,!DEFAULT", "text/plain"), - ("none-make", "make", "text/plain"), + ("none-make", "make -j", "text/plain"), # retry with nonshared smbd and smbtorture ("nonshared-distclean", "make distclean", "text/plain"), ("nonshared-configure", "./configure.developer " + samba_configure_params + " --bundled-libraries=talloc,tdb,pytdb,ldb,pyldb,tevent,pytevent --with-static-modules=ALL --nonshared-binary=smbtorture,smbd/smbd", "text/plain"), - ("nonshared-make", "make", "text/plain")], + ("nonshared-make", "make -j", "text/plain")], "ldb" : [ ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"), From 9e74377f62ef632f3c1db9c39ba4daa43899b4c5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 4 Jan 2016 14:20:54 +1300 Subject: [PATCH 5/6] autobuild: Use cp --recursive --link --archive This works on waf based builds as source files are not modified during the build Signed-off-by: Andrew Bartlett --- script/autobuild.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/script/autobuild.py b/script/autobuild.py index 16ea43f..935226b 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -222,7 +222,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] @@ -245,7 +245,10 @@ def __init__(self, name, sequence): 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): @@ -284,7 +287,7 @@ def __init__(self, tasklist, tasknames, rebase_url, rebase_branch="master"): 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" From 28dfac095577181fd3e8d12469f195b6a3a14114 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 4 Jan 2016 16:00:15 +1300 Subject: [PATCH 6/6] .travis.yml: Be like a normal autobuild and fail everything This avoids running long tests when we have failed in another VM Signed-off-by: Andrew Bartlett --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index ea60918..6e31545 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,10 @@ env: - TASK=tevent - TASK=pidl +# Fail everything after the first job fails +matrix: + fast_finish: true + before_install: - sudo apt-get update -qq - sudo apt-get install --assume-yes screen git build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev libpam0g-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev acl bison debhelper docbook-xml docbook-xsl flex libaio-dev libbsd-dev libcap-dev libcups2-dev libncurses5-dev libpam0g-dev libpopt-dev libreadline-dev perl perl-modules libparse-yapp-perl pkg-config python-all-dev python-dnspython xsltproc zlib1g-dev autoconf