From patchwork Sun Aug 25 17:36:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1152843 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="lEmH5rJY"; 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 46Gj514rSwz9sBF for ; Mon, 26 Aug 2019 03:37:25 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D6B8B86F8A; Sun, 25 Aug 2019 17:37:21 +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 1M4VkOrh4s6u; Sun, 25 Aug 2019 17:37:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 86F2C86E42; Sun, 25 Aug 2019 17:37:19 +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 014401BF589 for ; Sun, 25 Aug 2019 17:37:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F284286E42 for ; Sun, 25 Aug 2019 17:37:17 +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 2Aq9T0t8g7Cx for ; Sun, 25 Aug 2019 17:37:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by whitealder.osuosl.org (Postfix) with ESMTPS id 6652686B55 for ; Sun, 25 Aug 2019 17:37:17 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id w16so10060279pfn.7 for ; Sun, 25 Aug 2019 10:37:17 -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=vRCEe44cm5CWAlpUNLh2eYmIwRwQcieemUJanGOKaRc=; b=lEmH5rJYqvnCEDEh333tWRz+vp55GrC6SjK17Q0SRPzPSWO41beaHEZsP4sYrkn6H2 4MYXmTHh/YFtWExTnyBWyaeyPT105rovy/zSF51JRBuFI5eaziCNw5ppoWivXHJ3+q0t mA0Rgb+pNLVIn6IOjfz/t34P6dx/pLFY32T+xqD3zaNfvfCtp29+/l/5iz6eI5dhRN8h /YNX6D5GbMh6RQwMKfJ4LOn1TUgpZHTnmw/OGuGkdeC/3q0+Tl+P4EjOj3fAEcU1Ags3 96QBvr+2spMQ27zhqOcoO4urm75PTLwqfQVY7YhbDhd5U6pXLiDXkAqHuJomQecfTKGg N3Bw== 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=vRCEe44cm5CWAlpUNLh2eYmIwRwQcieemUJanGOKaRc=; b=aVuZbi4Amv4syieH36LTD5jrpPS+L94XsoSw+vD8adk457oVehxc8ljfcodHO72Ug+ efFqkoTOV+yKAfQgsiXXKB62ofOtSnuNalRw/NNR/o4rLjh4gzuoETwXeFC6xx/lMquf 7oMXP4ub4AfprTXYLa/1Cnw18Npn/YgbDW0S/ApRhpoEE569WfW/XH9pt0Q51tOmZQT+ 9eXbFPK+yQKvng8e7sQANvHCakCE1Fy6RNXqAX5KkzajixbYsqIBJ+Sw2/1LTdNwFnNu f3nUX+C0fLsuNvP35OHXi8CJV4e4quZMXvctfuK7VW19lbbMV8t4fBgVoYh2b25e9W+i 7m6w== X-Gm-Message-State: APjAAAVsFHp60RvyItgyccaiUX6Y8QhqGMvkvScXA5rRUj7b/Zq7vrjo ViptKnELZu2o4oX0iOOnB+XHQHoi/0U= X-Google-Smtp-Source: APXvYqwBDITsEJ/oDULUI29L/z33s+Lg4L6gtb1gAbfncBuq+jHsTBSupDL+Rl8cHtV36GsQPgTL/w== X-Received: by 2002:aa7:81ca:: with SMTP id c10mr16202964pfn.185.1566754636493; Sun, 25 Aug 2019 10:37:16 -0700 (PDT) Received: from localhost.localdomain ([123.201.194.34]) by smtp.gmail.com with ESMTPSA id s7sm10286661pfb.138.2019.08.25.10.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2019 10:37:15 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Sun, 25 Aug 2019 23:06:35 +0530 Message-Id: <20190825173635.23860-1-itsatharva@gmail.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] utils/br-reproduce-build: handle reproducibility failures 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" Add a condition to check if the config has BR2_REPRODUCIBLE enabled and if it does, run the build in two output directories - output-1, output-2 - and then run diffoscope on the generated images. NOTE: You should have diffoscope installed in order to test reproducibility failures. Signed-off-by: Atharva Lele --- utils/br-reproduce-build | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/utils/br-reproduce-build b/utils/br-reproduce-build index 592edc2..d8df3b2 100755 --- a/utils/br-reproduce-build +++ b/utils/br-reproduce-build @@ -76,7 +76,24 @@ if [ $? -ne 0 ] ; then exit 1 fi -mkdir ../output -cp "${BUILD_DIR}/config" ../output/.config -make olddefconfig O=../output/ -make 2>&1 O=../output | tee logfile +# Handle cases of testing reproducibility failures. +# Run the build in different output directories if BR2_REPRODUCIBLE=y +# and run diffoscope on the generated images. Output of diffoscope is +# saved in the "output-1" directory. +# NOTE: You should have diffoscope installed in order to test +# reproducibility failures. +if grep -Fxq "BR2_REPRODUCIBLE=y" "${BUILD_DIR}/config"; then + mkdir ../output-1 ../output-2 + cp "${BUILD_DIR}/config" ../output-1/.config + cp "${BUILD_DIR}/config" ../output-2/.config + make 2>&1 O=../output-1 | tee logfile && make 2>&1 O=../output-2 | tee logfile + PREFIX=$(make --no-print-directory O=../output-1 printvars VARS=TARGET_CROSS | cut -c 14- | head -c -1) + IMAGE_1="../output-1/images/rootfs.tar" + IMAGE_2="../output-2/images/rootfs.tar" + diffoscope ${IMAGE_1} ${IMAGE_2} --tool-prefix-binutils ${PREFIX} --text ../output-1/diffoscope_results.txt +else + mkdir ../output + cp "${BUILD_DIR}/config" ../output/.config + make olddefconfig O=../output/ + make 2>&1 O=../output | tee logfile +fi \ No newline at end of file