From patchwork Sun Oct 19 19:30:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 400841 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 09898140095 for ; Mon, 20 Oct 2014 06:31:25 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3128A91AED; Sun, 19 Oct 2014 19:31:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ixbHuvDrOyHf; Sun, 19 Oct 2014 19:31:20 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 64E1F91C95; Sun, 19 Oct 2014 19:30:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id BCA401C1E6B for ; Sun, 19 Oct 2014 19:30:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B2B4F91BD4 for ; Sun, 19 Oct 2014 19:30:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rs4iqpDsPxGE for ; Sun, 19 Oct 2014 19:30:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by whitealder.osuosl.org (Postfix) with ESMTPS id 966C991B18 for ; Sun, 19 Oct 2014 19:30:43 +0000 (UTC) Received: by mail-wi0-f181.google.com with SMTP id hi2so4702698wib.14 for ; Sun, 19 Oct 2014 12:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AhZzY+5+sIiHU6hughS7O0n3pW9kJ1OSzGvCj3pRmes=; b=ZL0bcVAqvdjgrBjFao87vLm4x7Nhwvp3NW6UI1SzuDbmLB3NgVkO1s9uyVDWNI5OFa Qh0QRZBHfD6lrZQd4tMij/lGYHYonDREeT2dYnQJfSzkykWE/jHfAZ71Ih558IaIKBAc hnpwe6bpIiAEXG6YYgHFPXPoUmLYLogxhL2qB919Osb4a1AKwgBSyfU1z9HBIoaRnjAN TVtfdhH7X4PV/PiNBlKzPl2K7berh/7VBvCVD/oq8EsQK1qeW1ZWpOS1P27eS0PyutV/ Dq6Bsyqhr4EDqxsnAMaAC0Xj3dk2HDUCUU7TLpUjVnghp6XpbG8Hs5KYRqoIf6tZ3CXo nigg== X-Received: by 10.180.105.74 with SMTP id gk10mr20119914wib.0.1413747042168; Sun, 19 Oct 2014 12:30:42 -0700 (PDT) Received: from localhost.localdomain (alc112.alcatel.be. [195.207.101.112]) by mx.google.com with ESMTPSA id ex6sm9390734wjb.20.2014.10.19.12.30.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Oct 2014 12:30:41 -0700 (PDT) From: Thomas De Schampheleire To: thomas.petazzoni@free-electrons.com Date: Sun, 19 Oct 2014 21:30:02 +0200 Message-Id: <1413747007-24990-7-git-send-email-patrickdepinguin@gmail.com> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1413747007-24990-1-git-send-email-patrickdepinguin@gmail.com> References: <1413747007-24990-1-git-send-email-patrickdepinguin@gmail.com> Cc: Thomas De Schampheleire , buildroot@buildroot.org Subject: [Buildroot] [PATCHv2 buildroot-test 06/11] autobuild-run: add option --make-opts for custom Buildroot options X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Thomas De Schampheleire In some environments, the Buildroot configuration may need minor tweaking. For example, in corporate environments behind a firewall, version control commands like git, svn, ... may actually need wrappers. Such wrappers could be configured using the corresponding BR2_ configuration options. Since these tweaks are very environment-specific, they should not be part of the configuration file itself. Otherwise, other people trying to reproduce the build in another environment will see builds failing due to other reasons, for example the wrapper not being found. This commit provides a new configuration option 'make-opts', passable as argument or in the config file, that accepts a string of make options to pass to the Buildroot make command. For example: --make-opts="BR2_GIT=git-wrapper BR2_svn=svn-wrapper" Signed-off-by: Thomas De Schampheleire --- v2: rebase after reordering scripts/autobuild-run | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index 061ae31..40bcaa0 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -72,6 +72,9 @@ Options: reasons it is recommended to define this in the config file instead, with user-read permissions only) + --make-opts OPTSTRING string of extra options to pass to Buildroot + make, such as specific command wrappers + [default: ] -c, --config CONFIG path to configuration file Format of the configuration file: @@ -406,7 +409,7 @@ def gen_config(instance, log, sysinfo): return 0 -def do_build(instance, njobs, log): +def do_build(instance, njobs, log, make_opts): """Run the build itself""" idir = "instance-%d" % instance @@ -419,8 +422,10 @@ def do_build(instance, njobs, log): srcdir = os.path.join(idir, "buildroot") f = open(os.path.join(outputdir, "logfile"), "w+") log_write(log, "INFO: build started") - ret = subprocess.call(["timeout", str(MAX_DURATION), "make", "O=%s" % outputdir, "-C", srcdir, - "BR2_DL_DIR=%s" % dldir, "BR2_JLEVEL=%s" % njobs], stdout=f, stderr=f) + cmd = ["timeout", str(MAX_DURATION), "make", "O=%s" % outputdir, + "-C", srcdir, "BR2_DL_DIR=%s" % dldir, "BR2_JLEVEL=%s" % njobs] \ + + make_opts.split() + ret = subprocess.call(cmd, stdout=f, stderr=f) # 124 is a special error code that indicates we have reached the # timeout if ret == 124: @@ -511,7 +516,8 @@ def send_results(instance, http_login, http_password, submitter, log, result): os.rename(os.path.join(outputdir, "results.tar.bz2"), resultfilename) log_write(log, "INFO: results saved as %s" % resultfilename) -def run_instance(instance, njobs, http_login, http_password, submitter, sysinfo): +def run_instance(instance, njobs, http_login, http_password, submitter, + make_opts, sysinfo): """Main per-instance loop Prepare the build, generate a configuration, run the build, and submit the @@ -537,7 +543,7 @@ def run_instance(instance, njobs, http_login, http_password, submitter, sysinfo) if ret != 0: continue - ret = do_build(instance, njobs, instance_log) + ret = do_build(instance, njobs, instance_log, make_opts) send_results(instance, http_login, http_password, submitter, instance_log, ret) # args / config file merging inspired by: @@ -597,7 +603,7 @@ def main(): for i in range(0, int(args['--ninstances'])): p = Process(target=run_instance, args=(i, int(args['--njobs']), args['--http-login'], args['--http-password'], - args['--submitter'], sysinfo)) + args['--submitter'], args['--make-opts'], sysinfo)) p.start() processes.append(p) signal.signal(signal.SIGTERM, sigterm_handler)