all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: "Gábor Boskovits" <boskovits@gmail.com>
Cc: 30104@debbugs.gnu.org
Subject: bug#30104: [PATCH] gnu: ant-bootstrap: Make build reproducible.
Date: Tue, 12 Jun 2018 15:15:47 +0200	[thread overview]
Message-ID: <87r2lcp2m4.fsf@gnu.org> (raw)
In-Reply-To: <20180611115245.11851-1-boskovits@gmail.com> ("Gábor Boskovits"'s message of "Mon, 11 Jun 2018 13:52:45 +0200")

Hello!

Gábor Boskovits <boskovits@gmail.com> skribis:

> * gnu/packages/java.scm (ant-bootstrap)[arguments]<#:phases>[strip-jar-timestamps]:
> New phase to reset jar file timestamps.
> <#:imported-modules>: Import guix build syscalls, gnu-build-system-modules.
> <#:modules>: Import guix build: gnu-build-system, utils, syscalls.
> [native-inputs]: Add unzip, zip.

Great that you’re tackling this issue!

I have very minor comments:

> +         (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (define (repack-archive jar)
> +               (let* ((dir (mkdtemp! "jar-contents.XXXXXX"))
> +                      (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
> +                 (and (with-directory-excursion dir
> +                        (invoke "unzip" jar))
> +                      (delete-file jar)

‘invoke’ throws an exception upon failure, and the return value of
‘delete-file’ is unspecified, so you shouldn’t rely on it.

Thus, it should be written without ‘and’:

  (with-directory-excursion
    (invoke "unzip" jar))
  (delete-file jar)
  …

> +                      ;; It is important that the manifes appears first.
                                                            ^
Typo.

> +                      (utime jar 0 0)

I think this is unnecessary because guix-daemon resets timestamps on all
the file upon build completion.

> +             (every repack-archive
> +                    (find-files
> +                     (string-append (assoc-ref %outputs "out") "/lib")
> +                     "\\.jar$"))))

Use ‘for-each’ instead of ‘every’ (because the return value of
‘repack-archive’ is undefined/unused), and add a trailing #t to denote
success.

If Ricardo and Julien don’t have anything to add, I think you can go
ahead and push with these changes.

Thank you!

Ludo’.

  reply	other threads:[~2018-06-12 13:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-14  4:16 bug#30104: ant-bootstrap@1.7.1 does not build reproducibly on core-updates Chris Marusich
2018-01-14  9:35 ` Gábor Boskovits
2018-01-14 16:40   ` Ricardo Wurmus
2018-01-18  8:58 ` bug#30104: Difference seems to be caused by timestamp Gábor Boskovits
2018-01-18  9:58   ` Gábor Boskovits
2018-06-11 11:52 ` bug#30104: [PATCH] gnu: ant-bootstrap: Make build reproducible Gábor Boskovits
2018-06-12 13:15   ` Ludovic Courtès [this message]
2018-06-12 13:21     ` Ricardo Wurmus
2018-06-18  8:38 ` bug#30104: ant-bootstrap does not build reproducibly Gábor Boskovits

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=87r2lcp2m4.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=30104@debbugs.gnu.org \
    --cc=boskovits@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.