unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars-Dominik Braun <lars@6xq.net>
To: 48933@debbugs.gnu.org
Cc: jlicht@fsfe.org
Subject: [bug#48933] [PATCH] build: Make outputs of node-build-system reproducible.
Date: Wed, 9 Jun 2021 14:56:58 +0200	[thread overview]
Message-ID: <YMC6mp3HDmRyjAd4@noor.fritz.box> (raw)

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 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/guix/build/node-build-system.scm b/guix/build/node-build-system.scm
index a55cab237c..9b3de43e24 100644
--- a/guix/build/node-build-system.scm
+++ b/guix/build/node-build-system.scm
@@ -120,7 +120,15 @@
   #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"
+          "--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime"
+          "-czf" "../package.tgz" ".")
   #t)
 
 (define* (install #:key outputs inputs #:allow-other-keys)
-- 
2.31.1





             reply	other threads:[~2021-06-09 12:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 12:56 Lars-Dominik Braun [this message]
2021-06-16 20:51 ` [bug#48933] [PATCH] build: Make outputs of node-build-system reproducible Ludovic Courtès
2021-06-17 12:12   ` Lars-Dominik Braun
2021-06-20 20:58     ` Ludovic Courtès
2021-06-24 12:12       ` bug#48933: " Lars-Dominik Braun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YMC6mp3HDmRyjAd4@noor.fritz.box \
    --to=lars@6xq.net \
    --cc=48933@debbugs.gnu.org \
    --cc=jlicht@fsfe.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).