From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Subject: Re: "jar" tool and and reproducible builds - how? Date: Tue, 5 Nov 2019 18:17:20 +0100 Message-ID: References: <20191104181842.0d392ece@scratchpost.org> <20191105104942.519cae91@scratchpost.org> <20191105160953.1a0cb1d6@scratchpost.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000091735d05969c9b35" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:39432) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iS2SV-0007pd-59 for guix-devel@gnu.org; Tue, 05 Nov 2019 12:17:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iS2ST-00073B-VE for guix-devel@gnu.org; Tue, 05 Nov 2019 12:17:35 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:39678) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iS2ST-000730-OY for guix-devel@gnu.org; Tue, 05 Nov 2019 12:17:33 -0500 Received: by mail-ed1-x533.google.com with SMTP id l25so16815626edt.6 for ; Tue, 05 Nov 2019 09:17:33 -0800 (PST) In-Reply-To: <20191105160953.1a0cb1d6@scratchpost.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Danny Milosavljevic Cc: Guix-devel --00000000000091735d05969c9b35 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, Danny Milosavljevic ezt =C3=ADrta (id=C5=91pont: 2= 019. nov. 5., Ke 16:09): > Hi G=C3=A1bor, > > > 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, a= nd > > 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 > --00000000000091735d05969c9b35 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

Danny Milosavljevic <dannym@scratchpost.org> ezt =C3=ADrta (id=C5=91pon= t: 2019. nov. 5., Ke 16:09):
Hi G= =C3=A1bor,

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

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

But I'd prefer if our "jar" tool did that on its own if SOURC= E_DATE_EPOCH
is set--I don't think the code above is maintainable.
<= /div>
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):

=C2=A0 =C2=A0 (arguments
=C2=A0 =C2=A0 =C2=A0`(#:modules
=C2=A0 =C2=A0 =C2=A0 =C2=A0((guix build gnu-build-system)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((guix build ant-build-system) #:prefix ant:) =C2=A0 =C2=A0 =C2=A0 =C2=A0 (guix build utils))
=C2=A0 =C2=A0 =C2=A0 =C2=A0#:phases
=C2=A0 =C2=A0 =C2=A0 =C2=A0(modify-phases %standard-phases
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(add-after 'install 'strip-jar-ti= mestamps
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(assoc-ref ant:%standard-phases &#= 39;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
--00000000000091735d05969c9b35--