From patchwork Tue Jun 11 12:34:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1113794 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="k6SQq4Sg"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45NTwK0sMzz9sN4 for ; Tue, 11 Jun 2019 22:34:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6130E87BDE; Tue, 11 Jun 2019 12:34:36 +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 CpkJOdFm432z; Tue, 11 Jun 2019 12:34:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 99BC687B3D; Tue, 11 Jun 2019 12:34:34 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id BB3CD1BF97C for ; Tue, 11 Jun 2019 12:34:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B810720447 for ; Tue, 11 Jun 2019 12:34:33 +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 fpwkBCdwucB1 for ; Tue, 11 Jun 2019 12:34:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by silver.osuosl.org (Postfix) with ESMTPS id B00B520031 for ; Tue, 11 Jun 2019 12:34:32 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id 196so6910804pgc.6 for ; Tue, 11 Jun 2019 05:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MPV2UGhI1Kp3ThTiooSgARDJVcscNdyhXko/sj6UzTg=; b=k6SQq4SgjgQcbklj8i/yu580OqBzmnaMG6ryUyv1kmJx51l7wnLycx3LJoOZXv+WX0 cZ5z+yu18gLPzprsQfKdI1AsgGAqitKJ7weL170SMP3kaSoZOv/RicirUdxiMXKQXDjR a1Q0mszEpjNjasyD8pONU5DroYwgxRoyowI/47AXbcfTKWPL3+jChRR2kmSp+Ztkw7fo mOexls75CqAXHeeeFQHRSrD7SYVIAUjOKXw4xQ0N3tBk2x64Oed6AHbG2nkUBhxNiflM mi//ZDTJS8bq+M0KeqdEytl7U4WTKK7R4FP5ZB9Ti91vfTR72nWlXmKaWvDNR5sc4k8o 0v1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MPV2UGhI1Kp3ThTiooSgARDJVcscNdyhXko/sj6UzTg=; b=RkzpXCnPyyHq5psP4WE5HrGHV0Tcx0p6dKQAwCl84Kbcp/mAA9IwDYNzQ0DeqDNXaE si6PnpcN+2yjElg2w7ercTEvdLsc0oucoUPFhJingLp/FstyWqdGhiMGpXEo0QAcsPn1 RxYRRkqiA/L6agcq3WkkM8GO/MGfHxPljpi84S+d71gqhL8i/mx7w0wzgM4mNbAYljWz ATjz/0nXQDwisMQ8wXi9cmTQmmeReI25rkY7nPu6L1TaFb050sCqZzMdyYeCOUW7i1f8 bGIuZXG9BH1SuBLx2X7UOCLpSwG8qt0b6GAoXEu3urO0n51OY0bF/TwEglfRl+mWVxt+ sgUw== X-Gm-Message-State: APjAAAWRRykjrX4s2UfRlHZdNrkVdRd/6lkSZBAf+rBwLpfi7FoO3agd nnuiJOKG2vK5fnDJHZ1bo+0rKrU+SO14tg== X-Google-Smtp-Source: APXvYqz/khGzKguIvBXPcU76Lo7RzRJWXC7IMkxy2dMpy92TjWSiSfU7/SD0r7aSQ7QUWlTTsXo0rw== X-Received: by 2002:a62:1dd0:: with SMTP id d199mr27583056pfd.257.1560256471420; Tue, 11 Jun 2019 05:34:31 -0700 (PDT) Received: from localhost.localdomain ([123.201.52.193]) by smtp.gmail.com with ESMTPSA id n2sm17747985pgp.27.2019.06.11.05.34.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 11 Jun 2019 05:34:30 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Tue, 11 Jun 2019 18:04:14 +0530 Message-Id: <20190611123416.11533-1-itsatharva@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 1/3] autobuild-run: initial implementation of check_reproducibility() X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atharva Lele , yann.morin.1998@free.fr, thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" For reproducible builds, we want to find out if there are any differences between two builds having the same configuration, and to find the reason behind them. The diffoscope tool looks inside different types of files to see where the differences lie. check_reproducibility() runs diffoscope on two output directories which are expected in output/images and output/images-1. Since it uses objdump, it needs to be provided the cross-compile prefix which is derived from the TARGET_CROSS variable. Since diffoscope may not be installed, we fall back to cmp for byte-by-byte comparison. We add diffoscope to list of optional programs to avoid repeated checking of its presence. Signed-off-by: Atharva Lele Reviewed-by: Yann E. MORIN --- Changes v2 -> v3: - Use file size of reproducible_results to check reproducibility status, rather than exit status of cmp or diff (suggested by arnout) - Rename results file (diffoscope_output.txt -> reproducible_results) to avoid confusion - Change handling of diffoscope output text file using with open() - Changed commit message to have all necessary info (suggested by arnout) - Removed leftover code from when I was using an exception to handle diffoscope presense (thanks to arnout) Changes v1 -> v2: - move diffoscope output to results dir (suggested by arnout) - fix make printvars call - Add diffoscope to DEFAULT_OPTIONAL_PROGS Signed-off-by: Atharva Lele --- scripts/autobuild-run | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index 190a254..ba5b337 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -204,7 +204,7 @@ def get_branch(): class SystemInfo: DEFAULT_NEEDED_PROGS = ["make", "git", "gcc"] - DEFAULT_OPTIONAL_PROGS = ["bzr", "java", "javac", "jar"] + DEFAULT_OPTIONAL_PROGS = ["bzr", "diffoscope", "java", "javac", "jar"] def __init__(self): self.needed_progs = list(self.__class__.DEFAULT_NEEDED_PROGS) @@ -394,6 +394,43 @@ def stop_on_build_hang(monitor_thread_hung_build_flag, break monitor_thread_stop_flag.wait(30) +def check_reproducibility(**kwargs): + """Check reproducibility of builds + + Use diffoscope on the built images, if diffoscope is not + installed, fallback to cmp + """ + + log = kwargs['log'] + idir = "instance-%d" % kwargs['instance'] + outputdir = os.path.join(idir, "output") + srcdir = os.path.join(idir, "buildroot") + reproducible_results = os.path.join(outputdir, "results", "reproducible_results") + # Using only tar images for now + build_1_image = os.path.join(outputdir, "images-1", "rootfs.tar") + build_2_image = os.path.join(outputdir, "images", "rootfs.tar") + + with open(reproducible_results, 'w') as diff: + if kwargs['sysinfo'].has("diffoscope"): + # Prefix to point diffoscope towards cross-tools + prefix = subprocess.check_output(["make", "O=%s" % outputdir, "-C", srcdir, "printvars", "VARS=TARGET_CROSS"]) + # Remove TARGET_CROSS= and \n from the string + prefix = prefix[13:-1] + log_write(log, "INFO: running diffoscope on images") + subprocess.call(["diffoscope", build_1_image, build_2_image, + "--tool-prefix-binutils", prefix], stdout=diff, stderr=log) + else: + log_write(log, "INFO: diffoscope not installed, falling back to cmp") + subprocess.call(["cmp", "-b", "build_1_image", "build_2_image"], stdout=diff, stderr=log) + + if os.stat(reproducible_results).st_size > 0: + log_write(log, "INFO: Build is non-reproducible.") + return -1 + + # rootfs images match byte-for-byte -> reproducible image + log_write(log, "INFO: Build is reproducible!") + return 0 + def do_build(**kwargs): """Run the build itself""" From patchwork Tue Jun 11 12:34:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1113795 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BtCMFVUa"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45NTwQ0XzKz9sN4 for ; Tue, 11 Jun 2019 22:34:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id EE21D20031; Tue, 11 Jun 2019 12:34:42 +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 wK-lJqh9d7mU; Tue, 11 Jun 2019 12:34:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 66BAC20447; Tue, 11 Jun 2019 12:34:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2189A1BF97C for ; Tue, 11 Jun 2019 12:34:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1D4F38573E for ; Tue, 11 Jun 2019 12:34:40 +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 0YWZcmLS5CFL for ; Tue, 11 Jun 2019 12:34:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by whitealder.osuosl.org (Postfix) with ESMTPS id 5EA75854A0 for ; Tue, 11 Jun 2019 12:34:39 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id t7so2451472plr.11 for ; Tue, 11 Jun 2019 05:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nzqCnUl3H52UK5AVWoaQAMxvZZvhSPbSfv15vAyhVk8=; b=BtCMFVUazNi9XTrqbAL1aAIatq9Hre7y14K2HB5fUI3vUSOIaRM5RV1Xb7kHgBEuC6 juGVzurfiSGEDxCezETANuvnygiFYJLOZ2cP0aZKqKzOzRxhqx2fRW1OsJzxyUP7ma0N ZxdeKPBBe2LItRVF/87ZsuxrzSICoQJ2T7QrGzUL7EcmCMcDnjDhunKWU8hMnbk0+cOr 7z+/MBWFEOL63wp7u1c4SuZPBzEuFiNVk6a7yVFXeHcZMFfhP7oHLl9Csq1I+/wopM7L vtx5Nop8TSJ8nRnMp/WsejRgMJqgcJAZJxMnLMW8nwp9RjGFzCYX5rOPFLv0e3NC0nIT NTYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nzqCnUl3H52UK5AVWoaQAMxvZZvhSPbSfv15vAyhVk8=; b=jPITX0KqXNfcELpejSgkFDdvVtXkyuTd5xTWY1xodQ3c14y5AxMxz9VKkKvlTmfFKJ x2jcoh954MM/T6/4ia9VMsAq7I2ev07qdwd6oicxvGF2+k2NpyXWQA2OmkHzlmW8dGwY kvkCBiCQH045/QoSniDcrVhUSTpQ2ZH0guJcrh72/fva9caPk41BcJUSMLj7igUHL6qz eoP9L61wwgDLQyEHw21A5WT2J2u41j2V+ay7s/IEIGM40Yxy87p82ciAldgiv1ob94ag c6DTCUD+OEpZ8HulV0BjxtCFbj6gT5n56P2NPVVL205wjjPWDVP+YQ37C9ifyL/jeWer wJiw== X-Gm-Message-State: APjAAAUd8ynKmnpuYC8rI9FlC1NuAvL0VujvFbVqy0AK9aDwsvveG3QC Kcrk7jQ/8bP9op8aGDKd6MGig22tpIMhsg== X-Google-Smtp-Source: APXvYqxFOc5TA/Si3nypyM3LE9jDjbfuf8oKL5aYemmum4fxllmVqngNkI4QVhvNHwoyg4wpBVPaZQ== X-Received: by 2002:a17:902:8490:: with SMTP id c16mr77823078plo.259.1560256478408; Tue, 11 Jun 2019 05:34:38 -0700 (PDT) Received: from localhost.localdomain ([123.201.52.193]) by smtp.gmail.com with ESMTPSA id n2sm17747985pgp.27.2019.06.11.05.34.35 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 11 Jun 2019 05:34:37 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Tue, 11 Jun 2019 18:04:15 +0530 Message-Id: <20190611123416.11533-2-itsatharva@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190611123416.11533-1-itsatharva@gmail.com> References: <20190611123416.11533-1-itsatharva@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 2/3] autobuild-run: initial implementation of do_reproducible_build() X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atharva Lele , yann.morin.1998@free.fr, thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This new function will call do_build() twice to produce two builds and then check their reproducibility. Signed-off-by: Atharva Lele Reviewed-by: Arnout Vandecappelle (Essensium/Mind) Reviewed-by: Yann E. MORIN --- Changes v2 -> v3: - make clean outputs to logfile, similar to other make calls (suggested by y_morin) - Output dir needs abspath (suggested by y_morin) - Directly use make clean as arguments rather than putting it into a variable - Added missing period at end of commit message (suggested by arnout) Changes v1 -> v2: - make clean outputs to devnull (suggested by arnout) - remove unnecessary arguments to make clean (suggested by arnout) Signed-off-by: Atharva Lele --- scripts/autobuild-run | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index ba5b337..5ba6092 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -492,6 +492,43 @@ def do_build(**kwargs): log_write(log, "INFO: build successful") return 0 +def do_reproducible_build(**kwargs): + """Run the builds for reproducibility testing + + Build twice with the same configuration. Calls do_build() to + perform the actual build. + """ + + idir = "instance-%d" % kwargs['instance'] + outputdir = os.path.abspath(os.path.join(idir, "output")) + srcdir = os.path.join(idir, "buildroot") + log = kwargs['log'] + + # Start the first build + log_write(log, "INFO: Reproducible Build Test, starting build 1") + ret = do_build(**kwargs) + if ret != 0: + log_write(log, "INFO: build 1 failed, skipping build 2") + return ret + + # First build has been built, move files and start build 2 + os.rename(os.path.join(outputdir, "images"), os.path.join(outputdir, "images-1")) + + # Clean up build 1 + f = open(os.path.join(outputdir, "logfile"), "w+") + subprocess.call(["make", "O=%s" % outputdir, "-C", srcdir, "clean"], stdout=f, stderr=f) + + # Start the second build + log_write(log, "INFO: Reproducible Build Test, starting build 2") + ret = do_build(**kwargs) + if ret != 0: + log_write(log, "INFO: build 2 failed") + return ret + + # Assuming both have built successfully + ret = check_reproducibility(**kwargs) + return ret + def send_results(result, **kwargs): """Prepare and store/send tarball with results From patchwork Tue Jun 11 12:34:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1113796 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hK7q/9Hn"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45NTwV6pVyz9sNR for ; Tue, 11 Jun 2019 22:34:50 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 19C2B86D81; Tue, 11 Jun 2019 12:34:48 +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 8Zjs+k+VUQc7; Tue, 11 Jun 2019 12:34:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 5D12B8573E; Tue, 11 Jun 2019 12:34:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 914091BF97C for ; Tue, 11 Jun 2019 12:34:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8A82986A40 for ; Tue, 11 Jun 2019 12:34:45 +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 8lBXPe5mH-kk for ; Tue, 11 Jun 2019 12:34:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0C8F9854A0 for ; Tue, 11 Jun 2019 12:34:45 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id bi6so4672022plb.12 for ; Tue, 11 Jun 2019 05:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KrX3h1GmVg5EwIOVtclZeA0TIMltmKNum+vVj0vFWTo=; b=hK7q/9HnLozpLfS3jbsCv1EMJzjXzP9q4KKX1feV/+yEPiRqqSobqNb0sHtyiJh0zg Ox94wsncYgkJM2yYsPRfCPD+Lqkkujx3cVFmjg8mo55UJOe6tPl92Qub3vBMf2AIRImy iP4JxQgynDUfT97rJrMlEZQNafTtaO+/q2IlJau+7Ht5Hxb0uIG25y2Qa0Qgx7q/9aba AXBtCnIWwznv9zaWbm7dje5KOBesglnQ72sVfAQsSQkrpQgG+7bnDafGE1HXjKpaUaGW CcjFVhwaVtsofHB7yBXz18H7+vnZ9+o1IitGqOIt0mo52MOytauDWx8Kbmh5FXxK368d UfwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KrX3h1GmVg5EwIOVtclZeA0TIMltmKNum+vVj0vFWTo=; b=ez7onm3vwunmruL/IT/A20y3G+RUOJSCGo/9H/UBqdOmJ/XZV5/eQDcmYWmDXZEDkC S92Yunnz4ys1EFDLLJ5H4cunh2P7yvAcQyjGtyfCGVI+GFNM3lb0U7rNIP6lN6KTIIBc p1HxNgY+WqjO37tQWQdKT/u7VEiDTDH9OthJXfu8yftVB8kfNDaFvM/dJJyENjO9JVev NndvtsNC5wjq+eoKQ+RA0b+WHEkZk0ym5ACRnlRzZr3A/0BggUAnrXYGz+vIjgcMBKaR 0jalDptllzBH7bGw1Do9oMK2pBk/H6T58RLoxna735TuKmKacrVyYJX5olRiNL1Ztumz QVgg== X-Gm-Message-State: APjAAAVsaVcFb+93u+kiEXqVbvqsifYmiMj/JoVANHlfc9z6kkfVi665 9xMO35uHUIigjvUIdeYj8ohjQI3lTHXXuQ== X-Google-Smtp-Source: APXvYqzyXFTyJcfHZmufF/RlvYe8oY821nEPy3tU1lAligXPjdjqYILsEFR3AlnuA1KtEVgLmTb87g== X-Received: by 2002:a17:902:8f87:: with SMTP id z7mr49159349plo.65.1560256484092; Tue, 11 Jun 2019 05:34:44 -0700 (PDT) Received: from localhost.localdomain ([123.201.52.193]) by smtp.gmail.com with ESMTPSA id n2sm17747985pgp.27.2019.06.11.05.34.40 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 11 Jun 2019 05:34:42 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Tue, 11 Jun 2019 18:04:16 +0530 Message-Id: <20190611123416.11533-3-itsatharva@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190611123416.11533-1-itsatharva@gmail.com> References: <20190611123416.11533-1-itsatharva@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 3/3] autobuild-run: do reproducible builds tests if BR2_REPRODUCIBLE=y X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atharva Lele , yann.morin.1998@free.fr, thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Atharva Lele Reviewed-by: Arnout Vandecappelle (Essensium/Mind) --- Changes v2 -> v3: - use reproducible flag so that .config i snot kept open for the entire build duration. (suggested by arnout) - remove reduntant logging (suggested by arnout) Changes v1 -> v2: - add trailing newline character to BR2_REPRODUCIBLE=y (suggested by arnout) Signed-off-by: Atharva Lele --- scripts/autobuild-run | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index 5ba6092..4fbd507 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -727,7 +727,14 @@ def run_instance(**kwargs): log_write(kwargs['log'], "WARN: failed to generate configuration") continue - ret = do_build(**kwargs) + # Check if the build test is supposed to be a reproducible test + outputdir = os.path.abspath(os.path.join(idir, "output")) + with open(os.path.join(outputdir, ".config"), "r") as fconf: + reproducible = "BR2_REPRODUCIBLE=y\n" in fconf.read() + if reproducible: + ret = do_reproducible_build(**kwargs) + else: + ret = do_build(**kwargs) send_results(ret, **kwargs)