all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Lars-Dominik Braun <lars@6xq.net>
Cc: 48933@debbugs.gnu.org, jlicht@fsfe.org
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: <87bl85pm6o.fsf@gnu.org> (raw)
In-Reply-To: <YMC6mp3HDmRyjAd4@noor.fritz.box> (Lars-Dominik Braun's message of "Wed, 9 Jun 2021 14:56:58 +0200")

Hi,

Lars-Dominik Braun <lars@6xq.net> 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.

Yay!

>  (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=@".

> +          "--owner=0"
> +          "--group=0"
> +          "--numeric-owner"
> +          "--pax-option=exthdr.name=%d/PaxHeaders/%f,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.
    "--hard-dereference"))
--8<---------------cut here---------------end--------------->8---

and (guix packages) does something similar.

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

HTH,
Ludo’.




  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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=87bl85pm6o.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=48933@debbugs.gnu.org \
    --cc=jlicht@fsfe.org \
    --cc=lars@6xq.net \
    --subject='Re: [bug#48933] [PATCH] build: Make outputs of node-build-system reproducible.' \
    /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

all messages for Guix-related lists mirrored at yhetil.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix

Example config snippet for mirrors.


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