From patchwork Thu Jun 17 12:12:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lars-Dominik Braun X-Patchwork-Id: 30331 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 0B67D27BC81; Thu, 17 Jun 2021 13:13:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C2BE227BC78 for ; Thu, 17 Jun 2021 13:13:17 +0100 (BST) Received: from localhost ([::1]:50732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltqtY-0005t6-MH for patchwork@mira.cbaines.net; Thu, 17 Jun 2021 08:13:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59450) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltqtK-0005qX-GU for guix-patches@gnu.org; Thu, 17 Jun 2021 08:13:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42355) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltqtK-0005KC-7e for guix-patches@gnu.org; Thu, 17 Jun 2021 08:13:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ltqtJ-0007A6-Vz for guix-patches@gnu.org; Thu, 17 Jun 2021 08:13:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48933] [PATCH] build: Make outputs of node-build-system reproducible. Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Jun 2021 12:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48933 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: 48933@debbugs.gnu.org, jlicht@fsfe.org Received: via spool by 48933-submit@debbugs.gnu.org id=B48933.162393195827495 (code B ref 48933); Thu, 17 Jun 2021 12:13:01 +0000 Received: (at 48933) by debbugs.gnu.org; 17 Jun 2021 12:12:38 +0000 Received: from localhost ([127.0.0.1]:53901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltqsw-00079O-AW for submit@debbugs.gnu.org; Thu, 17 Jun 2021 08:12:38 -0400 Received: from mout-p-202.mailbox.org ([80.241.56.172]:58046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltqsr-000798-PM for 48933@debbugs.gnu.org; Thu, 17 Jun 2021 08:12:37 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4G5LXW3GLSzQk1c; Thu, 17 Jun 2021 14:12:27 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1623931945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vGVMYTucg0H+mEte6nNXYIrfciVgm/6hpg5AnNSHzZI=; b=liy+8VbP4q+KG+YA5wqrcJ2RFKVVItzpttAZIHANrz0+l/yYab9odBRimmy3vYxCZNsBNP PiA4/Qyut9OHXlEK3EYXGpxFYD3sO0XfYfFeZtvDabCjVGv1mmXA1Q6H53Z2wJ6yeZnYU9 NYIZQhlM+c6dtohtpoBxfRbkOdVIHh2sco0HMagLZjOKcvJ6h7hk57WknjEc3T1JcZbbwt B+FpRfM5AqYbxvgDXHtIdHSYvTt4GsRi0jGnA9VT8auP8ZY7GQSRtmvp9rrELwnHYW62nJ H1KHjn2NHkIq0fC/Hdb2kWkDfbeJjwsSwdQl8qW2kzFQmjcBocKVYmj05N9mPA== Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id a-omlJZ2uVZX; Thu, 17 Jun 2021 14:12:20 +0200 (CEST) Date: Thu, 17 Jun 2021 14:12:18 +0200 From: Lars-Dominik Braun Message-ID: References: <87bl85pm6o.fsf@gnu.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87bl85pm6o.fsf@gnu.org> X-MBO-SPAM-Probability: X-Rspamd-Score: -6.58 / 15.00 / 15.00 X-Rspamd-Queue-Id: 1E4911860 X-Rspamd-UID: 9c52a8 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi Ludo, > > (define* (repack #:key inputs #:allow-other-keys) > > - (invoke "tar" "-czf" "../package.tgz" ".") > > + (invoke "tar" > > + ;; Add options suggested by https://reproducible-builds.org/docs/archives/ * > > + "--sort=name" > > + (string-append "--mtime=" (getenv "SOURCE_DATE_EPOCH")) > > I think it should be "--mtime=@". you’re right, fixed. > I didn’t know about this ‘--pax-option’ trick; since it’s only useful > when POSIXLY_CORRECT is set, perhaps we can remove it? True, removed. > (guix docker) does this: > and (guix packages) does something similar. Hm, maybe it would make sense to export a set of options, so build systems/packages can share them? Or create a package that wraps tar with the proper options? > So ‘--sort=name’ seems to be missing. It’s present, see above ↑* Updated patch attached. I’ll push it if there are no further comments. Cheers, Lars From 6692ebc8561d4e419c276fcdd01a4088d29c5fd7 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 17 Jun 2021 14:11:19 +0200 Subject: [PATCH] build: Make outputs of node-build-system reproducible. package.json records two hashes of package.tgz, which change for each build, resulting in non-reproducible builds. * guix/build/node-build-system.scm (repack): Add reproducibility options to tar command. --- guix/build/node-build-system.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/guix/build/node-build-system.scm b/guix/build/node-build-system.scm index a55cab237c..70a367618e 100644 --- a/guix/build/node-build-system.scm +++ b/guix/build/node-build-system.scm @@ -120,7 +120,14 @@ #t) (define* (repack #:key inputs #:allow-other-keys) - (invoke "tar" "-czf" "../package.tgz" ".") + (invoke "tar" + ;; Add options suggested by https://reproducible-builds.org/docs/archives/ + "--sort=name" + (string-append "--mtime=@" (getenv "SOURCE_DATE_EPOCH")) + "--owner=0" + "--group=0" + "--numeric-owner" + "-czf" "../package.tgz" ".") #t) (define* (install #:key outputs inputs #:allow-other-keys) -- 2.31.1