From patchwork Thu Mar 14 00:54:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Skyler Ferris X-Patchwork-Id: 61790 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3E8F527BBEB; Thu, 14 Mar 2024 00:56:57 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 359E427BBEA for ; Thu, 14 Mar 2024 00:56:53 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rkZOX-0002Zj-Id; Wed, 13 Mar 2024 20:56:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rkZOV-0002ZS-Jf for guix-patches@gnu.org; Wed, 13 Mar 2024 20:56:27 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rkZOV-0006TV-8F for guix-patches@gnu.org; Wed, 13 Mar 2024 20:56:27 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rkZP4-0006Kp-EO for guix-patches@gnu.org; Wed, 13 Mar 2024 20:57:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69787] [PATCH] doc: Add notes about when to use --check Resent-From: skyvine@protonmail.com Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 14 Mar 2024 00:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69787@debbugs.gnu.org Cc: Skyler Ferris X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.171037776224216 (code B ref -1); Thu, 14 Mar 2024 00:57:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Mar 2024 00:56:02 +0000 Received: from localhost ([127.0.0.1]:47615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkZO5-0006IQ-7A for submit@debbugs.gnu.org; Wed, 13 Mar 2024 20:56:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:34064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkZNo-0006Hq-2h for submit@debbugs.gnu.org; Wed, 13 Mar 2024 20:55:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rkZNE-0002Tl-9L for guix-patches@gnu.org; Wed, 13 Mar 2024 20:55:08 -0400 Received: from mail-4322.protonmail.ch ([185.70.43.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rkZN7-00064b-KF for guix-patches@gnu.org; Wed, 13 Mar 2024 20:55:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1710377696; x=1710636896; bh=tJjPW64XinyLxU0/LghpPeJbKKfNIO4mdQfAW/wxTCc=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=O0r08Sm+X5umfUkQNhk+f0uTB94ArRuTy9YVFHOKv0EkEPT0zsgI2B09sc5nDo6w7 mHhTw86gGRsYQFHukjA/uEvdMQjnePRGBffl39HUupJo11O7QdnbkTAKl9futdsQ2o DFJ85/RF0DaYjtcxtO0CXvj7Ynj95aXASwun+55+2jc7j2BGprdpZuFOHePYlkLDZT vtgvc9GRRfpklJ3Z1sG0cPi/4ZdLALDx0WF3kT+0liV9VvGadKCpPz9aTA7KNAMnaS iSXXSzY/1rfs8J8+/Y2jiPntM5ceNmeAtvVPuSRgJlTyv+blMi8+XZw88kDa4bGy68 C2+x1/7SVivgA== Date: Thu, 14 Mar 2024 00:54:35 +0000 Message-ID: <179b4b762c1f4007fd648f614e9fbb124057a555.1710376829.git.skyvine@protonmail.com> Feedback-ID: 40635331:user:proton MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.43.22; envelope-from=skyvine@protonmail.com; helo=mail-4322.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: skyvine@protonmail.com X-ACL-Warn: , Skyler Ferris via Guix-patches X-Patchwork-Original-From: Skyler Ferris via Guix-patches via From: Skyler Ferris Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Skyler Ferris * doc/contributing.texi: Add notes about using --check when --rounds is insufficient Change-Id: I534b3f99181b45c4a955325a4ed59e3e7c651ab6 --- This is a small update to the section about checking that a package is reproducible, based on a conversation with Carlo Zancanaro on the help-guix mailing list. While this section does mention guix challenge, this is used with a separate substitute server. The notes about what happens with grafts comes from personal observations from running the commands on my machine. The situation seems less than ideal but I am not familiar enough with the code to figure out a way to improve it at the moment. If there is already a better way of getting the derivation path, especially a way that does not rely on the build output still being available (the person may have already closed the build terminal, and knowledge of the build log path implies knoweldge of the derviation path) please let me know and I will update this patch accordingly. doc/contributing.texi | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) base-commit: 447e9c96259e8fa15a828de9b2dd3400e2ffafe6 diff --git a/doc/contributing.texi b/doc/contributing.texi index a7d91724fb..aa8421cbb7 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -1495,15 +1495,33 @@ Submitting Patches typically means checking whether an independent build of the package yields the exact same result that you obtained, bit for bit. -A simple way to do that is by building the same package several times in +If you have not previously built the package, a simple way to check for +determinism is by building the same package several times in a row on your machine (@pxref{Invoking guix build}): @example guix build --rounds=2 my-package @end example -This is enough to catch a class of common non-determinism issues, such -as timestamps or randomly-generated output in the build result. +If you have already built the package @code{--rounds} is not sufficient +because @command{guix build} will see that the output is already available +and build 0 times. Instead, you can use the @code{--check} flag to compare a +fresh build against the previous output: + +@example +guix build --check my-package +@end example + +However, if the package is grafted (@pxref{Security Updates, grafts}) then +this will only check the grafts not the original package build. In this case +you can use the path to the derivation (@code{/gnu/store/-.drv}) +instead of the package name. The derivation path is printed by @command{guix build} +when it finishes building a derivation (note that the grafted version of the package +also has a derivation, so the most recently printed derivation path will not be the +one that you want to use). + +Either of these methods are enough to catch a class of common non-determinism +issues, such as timestamps or randomly-generated output in the build result. Another option is to use @command{guix challenge} (@pxref{Invoking guix challenge}). You may run it once the package has been committed and