From patchwork Tue Aug 20 14:52:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1150220 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="biSeV8qV"; 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 46CYh44zG8z9sNk for ; Wed, 21 Aug 2019 00:53:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C88B322850; Tue, 20 Aug 2019 14:53:22 +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 jHZ0Dp9b42Gw; Tue, 20 Aug 2019 14:53:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 3072B2288E; Tue, 20 Aug 2019 14:53:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 27C381BF82B for ; Tue, 20 Aug 2019 14:52:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 24DC187F92 for ; Tue, 20 Aug 2019 14:52:45 +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 iY6DH-dsRvyT for ; Tue, 20 Aug 2019 14:52:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by hemlock.osuosl.org (Postfix) with ESMTPS id A882281FB0 for ; Tue, 20 Aug 2019 14:52:44 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id w16so3533986pfn.7 for ; Tue, 20 Aug 2019 07:52:44 -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=0WabEcigge+baquWxE4XqX72KDWIXQvs3iGlK5MC+lo=; b=biSeV8qVWwc7Ych2x9goVNLwIynZ/0lOyiAsAAQf+kFSp0rNkiBt1GvvPnJT1/MF0t 7JSNA1ILtnHitHD9iJfjSfKrKBKDnEj+LttVnd/fIBd6MzyZ6798lS6IoYBFG26VjcxG /FfzgNMYXNjrmr9UkEnvoYC2uvOb7wvQZ+0k83JZESc5lAWIP6dCiTMpmhvO/bow4rTc zZC7EaJ6lu7B2uLxucOpNg53qtV8Wf/2g8nkU1O3pstEp2W2+mLISOx6bfomTZcvsgnF 5AHDcDxp3NUuhaASqgFWCKzHSF41fVudyzuaVbjz4QBrsRw8KZxDscYTa/NBukFkroxb Y/yg== 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=0WabEcigge+baquWxE4XqX72KDWIXQvs3iGlK5MC+lo=; b=l71tnLtZafJpSOa0NRAFZF0sGhhJAr/KTKrD9IApgzaP4aNDhLrnBzCVmB44xpDQNE JX/VPb6CBhbTjhHuzZEGwz3j2aoHnhnFFMGTyNx5sa/rfqu+LqIX8E++edMCrEQo+ujw jx5LyoO2fyDiarQX2HOtJSRPgMvBjguvuj/ZRP89SNEmNw1gQkH4agwmlRDkKGADNk7c ie9o8vVYPKBGpGMgucTEsvNhCZc5vHXLf4V5XMMoBHqkN+Z3u0JvdOvgpSgmw1tpr+di EyoWYMYfjbP0DJVAYs/vxpSAcSVbb/dI8SCVrGSMwKAmwgQN9nL6i/CiT7iTcCyo9su8 SGOw== X-Gm-Message-State: APjAAAXVjBfpZ6to7mr4/CsHHfQbgtWZf64jGWsZXaJTEj4NIsMNdGgA VQx5OgSGHLjtiSr9XX9u2Clwte/GsHA= X-Google-Smtp-Source: APXvYqy6iKmJ0kmwT3+pl3s38JjJ8a1riE2UbCpul6a/R/rPr4K8XjywPLnAuOxSWtg/fezqPhEuxw== X-Received: by 2002:a63:593:: with SMTP id 141mr16132562pgf.78.1566312763690; Tue, 20 Aug 2019 07:52:43 -0700 (PDT) Received: from localhost.localdomain ([123.201.116.168]) by smtp.gmail.com with ESMTPSA id a1sm24502643pgh.61.2019.08.20.07.52.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 07:52:43 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Tue, 20 Aug 2019 20:22:30 +0530 Message-Id: <20190820145231.15507-4-itsatharva@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190820145231.15507-1-itsatharva@gmail.com> References: <20190820145231.15507-1-itsatharva@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 4/5] autobuild-run: move with open to appropriate place in 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 , thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Since we switched to using diffoscope's ability to write to a file, having a with open() does not make sense while running the command. Instead, move it to the else condition where it can be used by cmp. Signed-off-by: Atharva Lele --- scripts/autobuild-run | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index 876feb2..c25413b 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -446,19 +446,19 @@ class Builder: build_1_image = os.path.join(self.outputdir, "images", "rootfs.tar") build_2_image = os.path.join(self.outputdir_2, "images", "rootfs.tar") - with open(reproducible_results, 'w') as diff: - if self.sysinfo.has("diffoscope"): - # Prefix to point diffoscope towards cross-tools - prefix = subprocess.check_output(["make", "--no-print-directory", "O=%s" % self.outputdir, - "-C", self.srcdir, "printvars", "VARS=TARGET_CROSS"]) - # Remove TARGET_CROSS= and \n from the string - prefix = prefix[13:-1] - log_write(self.log, "INFO: running diffoscope on images") - subprocess.call(["diffoscope", build_1_image, build_2_image, - "--tool-prefix-binutils", prefix, "--json", reproducible_results, - "--text", reproducible_results_txt, "--max-text-report-size", "40000"], - stderr=self.log) - else: + if self.sysinfo.has("diffoscope"): + # Prefix to point diffoscope towards cross-tools + prefix = subprocess.check_output(["make", "--no-print-directory", "O=%s" % self.outputdir, + "-C", self.srcdir, "printvars", "VARS=TARGET_CROSS"]) + # Remove TARGET_CROSS= and \n from the string + prefix = prefix[13:-1] + log_write(self.log, "INFO: running diffoscope on images") + subprocess.call(["diffoscope", build_1_image, build_2_image, + "--tool-prefix-binutils", prefix, "--json", reproducible_results, + "--text", reproducible_results_txt, "--max-text-report-size", "40000"], + stderr=self.log) + else: + with open(reproducible_results_txt, 'w') as diff: log_write(self.log, "INFO: diffoscope not installed, falling back to cmp") subprocess.call(["cmp", "-b", build_1_image, build_2_image], stdout=diff, stderr=self.log)