From patchwork Wed Aug 6 07:58:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 376932 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 409B714009B for ; Wed, 6 Aug 2014 17:58:39 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BB10D2F593; Wed, 6 Aug 2014 07:58:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9UDz2ICNbSLM; Wed, 6 Aug 2014 07:58:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id CA3B22F4F5; Wed, 6 Aug 2014 07:58:34 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id D6C931C1766 for ; Wed, 6 Aug 2014 07:58:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D0E518A175 for ; Wed, 6 Aug 2014 07:58:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cTSgP5wu3ISd for ; Wed, 6 Aug 2014 07:58:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by hemlock.osuosl.org (Postfix) with ESMTPS id C4CA48A170 for ; Wed, 6 Aug 2014 07:58:32 +0000 (UTC) Received: by mail-we0-f178.google.com with SMTP id w61so2145965wes.23 for ; Wed, 06 Aug 2014 00:58:31 -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; bh=oaV1UE+nFWxsEZMjwMoFzicAgGh7dZfyMnPMfTro9aE=; b=ktkDsxtzlZzanYjpYGxpX50WMNSmOnMLK8jXr5kmv0KlasQQTJvxiGDYBddIyFzULg kx5TKslCKdWBi1iJr6QQrMhcH+y2ujFU+jGO7sezTevSLCsIslCCQ+cZ8mAPqJ9IBobn FOAkhbQfd8bzKNi+w3eW1JURIgnfb0PCzv+Qhxk+Y6ww7U2rx6Fe0tYGmB8re+eLB2rk Hw9VWmFQQNZ4pmZMigCA48XvYk/9H9AHYMbQBCcrtzCAPqn0jG5LFeFAkEaVscKLW1rm sh/fCZcgGcVY4z4ExEI1oQxOq9ekmDs0nBKrt2IhlMHWvgSZtbM9/AatK5NHbTegl6Pz UQOQ== X-Received: by 10.194.243.200 with SMTP id xa8mr13302725wjc.97.1407311911213; Wed, 06 Aug 2014 00:58:31 -0700 (PDT) Received: from ld2077.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPSA id e3sm610484wjp.4.2014.08.06.00.58.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Aug 2014 00:58:30 -0700 (PDT) From: Fabio Porcedda To: Thomas Petazzoni Date: Wed, 6 Aug 2014 09:58:27 +0200 Message-Id: <1407311907-3878-1-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.0.4 Cc: buildroot@uclibc.org Subject: [Buildroot] [autobuild PATCH] autobuild-run: do not set BR2_JLEVEL and BR2_DL_DIR in the configuration X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 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-bounces@busybox.net Instead of setting BR2_JLEVEL and BR2_DL_DIR in the configuration file pass those variable as options on the command line, so that the configuration files can be re-used on other machines with no change. Signed-off-by: Fabio Porcedda --- scripts/autobuild-run | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index 95d84a9..c248473 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -44,10 +44,6 @@ # # TODO: # -# - Do not set BR2_JLEVEL and BR2_DL_DIR in the configuration file, -# but through the environment, so that the configuration files can -# be re-used on other machines with no change. -# # - Improve the logic that generates the 'build-end.log' file. Instead # of just using the last 500 lines of the build log, search the # start of the build of the failing package. @@ -257,7 +253,7 @@ def fixup_config(instance): # This function generates the configuration, by choosing a random # toolchain configuration and then generating a random selection of # packages. -def gen_config(instance, njobs, log): +def gen_config(instance, log): idir = "instance-%d" % instance dldir = os.path.join(idir, "dl") # We need the absolute path to use with O=, because the relative @@ -277,8 +273,6 @@ def gen_config(instance, njobs, log): configlines = config["contents"] # Amend the configuration with a few things. - configlines.append("BR2_DL_DIR=\"%s\"\n" % os.path.abspath(dldir)) - configlines.append("BR2_JLEVEL=%d\n" % njobs) configlines.append("BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y\n") configlines.append("# BR2_TARGET_ROOTFS_TAR is not set\n") if randint(0, 20) == 0: @@ -329,18 +323,19 @@ def gen_config(instance, njobs, log): return 0 # Run the build itself -def do_build(instance, log): +def do_build(instance, njobs, log): idir = "instance-%d" % instance # We need the absolute path to use with O=, because the relative # path to the output directory here is not relative to the # Buildroot sources, but to the location of the autobuilder # script. + dldir = os.path.abspath(os.path.join(idir, "dl")) outputdir = os.path.abspath(os.path.join(idir, "output")) 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], - stdout=f, stderr=f) + 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) # 124 is a special error code that indicates we have reached the # timeout if ret == 124: @@ -446,11 +441,11 @@ def run_instance(instance, njobs, http_login, http_password, submitter): if ret != 0: continue - ret = gen_config(instance, njobs, instance_log) + ret = gen_config(instance, instance_log) if ret != 0: continue - ret = do_build(instance, instance_log) + ret = do_build(instance, njobs, instance_log) send_results(instance, http_login, http_password, submitter, instance_log, ret) # Function to get the configuration parameters, either from the