guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "jar" tool and and reproducible builds - how?


From: Gábor Boskovits
Subject: Re: "jar" tool and and reproducible builds - how?
Date: Tue, 5 Nov 2019 18:17:20 +0100

Hello,

Danny Milosavljevic <address@hidden> ezt írta (időpont: 2019. nov. 5., Ke 16:09):
Hi Gábor,

> This looks like a jar timestamps issue. Adding a phase similar to
> strip-jar-timestamps in ant-build-system should work.
> It extracts the jar to a temporary directory, resets file timestamps, and
> then repacks it, and resets the timestamp on the archive.
> Could you check if that works for you?

Yes, the following works and makes it reproducible:

    (arguments
     `(#:imported-modules
       ((guix build utils)
        (guix build ant-build-system)
        (guix build gremlin)
        (guix build syscalls)
        (guix elf)
        (guix build gnu-build-system))
       #:phases
       (modify-phases %standard-phases
         (add-after 'install 'strip-jar-timestamps
           (assoc-ref (@ (guix build ant-build-system) %standard-phases)
                      'strip-jar-timestamps)))))
That is great.

But I'd prefer if our "jar" tool did that on its own if SOURCE_DATE_EPOCH
is set--I don't think the code above is maintainable.
Agreed. Could you open a wishlist bug for that, so it is not forgotten.

The following code does not work (doesn't find ant-build-system):

    (arguments
     `(#:modules
       ((guix build gnu-build-system)
        ((guix build ant-build-system) #:prefix ant:)
        (guix build utils))
       #:phases
       (modify-phases %standard-phases
         (add-after 'install 'strip-jar-timestamps
           (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))
I believe this strip-jar-timestamps code should be moved to the java utils module, so that it can be easier to reuse...

Best regards,g_bor

reply via email to

[Prev in Thread] Current Thread [Next in Thread]