From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#30104: [PATCH] gnu: ant-bootstrap: Make build reproducible. Date: Tue, 12 Jun 2018 15:15:47 +0200 Message-ID: <87r2lcp2m4.fsf@gnu.org> References: <87shb9axcp.fsf@gmail.com> <20180611115245.11851-1-boskovits@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSjAc-0006n4-2m for bug-guix@gnu.org; Tue, 12 Jun 2018 09:17:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSjAU-00069c-8z for bug-guix@gnu.org; Tue, 12 Jun 2018 09:17:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:36366) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSjAU-00069X-4K for bug-guix@gnu.org; Tue, 12 Jun 2018 09:17:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fSjAT-0006OX-V8 for bug-guix@gnu.org; Tue, 12 Jun 2018 09:17:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20180611115245.11851-1-boskovits@gmail.com> ("=?UTF-8?Q?G=C3=A1bor?= Boskovits"'s message of "Mon, 11 Jun 2018 13:52:45 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: =?UTF-8?Q?G=C3=A1bor?= Boskovits Cc: 30104@debbugs.gnu.org Hello! G=C3=A1bor Boskovits skribis: > * gnu/packages/java.scm (ant-bootstrap)[arguments]<#:phases>[strip-jar-ti= mestamps]: > New phase to reset jar file timestamps. > <#:imported-modules>: Import guix build syscalls, gnu-build-system-module= s. > <#:modules>: Import guix build: gnu-build-system, utils, syscalls. > [native-inputs]: Add unzip, zip. Great that you=E2=80=99re tackling this issue! I have very minor comments: > + (add-after 'build 'strip-jar-timestamps ;based on ant-build-sys= tem > + (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) =E2=80=98invoke=E2=80=99 throws an exception upon failure, and the return v= alue of =E2=80=98delete-file=E2=80=99 is unspecified, so you shouldn=E2=80=99t rely= on it. Thus, it should be written without =E2=80=98and=E2=80=99: (with-directory-excursion (invoke "unzip" jar)) (delete-file jar) =E2=80=A6 > + ;; 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 =E2=80=98for-each=E2=80=99 instead of =E2=80=98every=E2=80=99 (because = the return value of =E2=80=98repack-archive=E2=80=99 is undefined/unused), and add a trailing #= t to denote success. If Ricardo and Julien don=E2=80=99t have anything to add, I think you can go ahead and push with these changes. Thank you! Ludo=E2=80=99.