all messages for Guix-related lists mirrored at
 help / color / mirror / Atom feed
From: "Ludovic Courtès" <>
To: Lars-Dominik Braun <>
Subject: [bug#48933] [PATCH] build: Make outputs of node-build-system reproducible.
Date: Wed, 16 Jun 2021 22:51:59 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <> (Lars-Dominik Braun's message of "Wed, 9 Jun 2021 14:56:58 +0200")


Lars-Dominik Braun <> skribis:

> 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.


>  (define* (repack #:key inputs #:allow-other-keys)
> -  (invoke "tar" "-czf" "../package.tgz" ".")
> +  (invoke "tar"
> +          ;; Add options suggested by
> +          "--sort=name"
> +          (string-append "--mtime=" (getenv "SOURCE_DATE_EPOCH"))

I think it should be "--mtime=@".

> +          "--owner=0"
> +          "--group=0"
> +          "--numeric-owner"
> +          ",delete=atime,delete=ctime"
> +          "-czf" "../package.tgz" ".")

I didn’t know about this ‘--pax-option’ trick; since it’s only useful
when POSIXLY_CORRECT is set, perhaps we can remove it?

(guix docker) does this:

--8<---------------cut here---------------start------------->8---
(define %tar-determinism-options
  ;; GNU tar options to produce archives deterministically.
  '("--sort=name" "--mtime=@1"
    "--owner=root:0" "--group=root:0"

    ;; When 'build-docker-image' is passed store items, the 'nlink' of the
    ;; files therein leads tar to store hard links instead of actual copies.
    ;; However, the 'nlink' count depends on deduplication in the store; it's
    ;; an "implicit input" to the build process.  '--hard-dereference'
    ;; eliminates it.
--8<---------------cut here---------------end--------------->8---

and (guix packages) does something similar.

So ‘--sort=name’ seems to be missing.


  reply	other threads:[~2021-06-16 21:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 12:56 Lars-Dominik Braun
2021-06-16 20:51 ` Ludovic Courtès [this message]
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:

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

  git send-email \ \ \ \ \ \
    --subject='Re: [bug#48933] [PATCH] build: Make outputs of node-build-system reproducible.' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

all messages for Guix-related lists mirrored at

This inbox may be cloned and mirrored by anyone:

	git clone --mirror

Example config snippet for mirrors.

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git