From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QAXrH2oE02J4gwEAbAwnHQ (envelope-from ) for ; Sat, 16 Jul 2022 20:33:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iL30H2oE02LSpwAA9RJhRA (envelope-from ) for ; Sat, 16 Jul 2022 20:33:14 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2E9D636A86 for ; Sat, 16 Jul 2022 20:33:14 +0200 (CEST) Received: from localhost ([::1]:34356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCmbJ-0007yi-BZ for larch@yhetil.org; Sat, 16 Jul 2022 14:33:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCmTR-00063e-Bo for guix-patches@gnu.org; Sat, 16 Jul 2022 14:25:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCmTQ-0002Vv-CG for guix-patches@gnu.org; Sat, 16 Jul 2022 14:25:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCmTQ-00036r-8K for guix-patches@gnu.org; Sat, 16 Jul 2022 14:25:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56604] [PATCH 5/8] gnu: clojure: Update to 1.11.1.This patch updates Clojure to 1.11.1. It also adds the 'reset-class-timestamps Resent-From: r0man Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 18:25:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56604 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56604@debbugs.gnu.org Received: via spool by 56604-submit@debbugs.gnu.org id=B56604.165799586911840 (code B ref 56604); Sat, 16 Jul 2022 18:25:04 +0000 Received: (at 56604) by debbugs.gnu.org; 16 Jul 2022 18:24:29 +0000 Received: from localhost ([127.0.0.1]:46043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCmSr-00034u-0l for submit@debbugs.gnu.org; Sat, 16 Jul 2022 14:24:29 -0400 Received: from mail-ej1-f46.google.com ([209.85.218.46]:35449) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCmSo-00034I-E2 for 56604@debbugs.gnu.org; Sat, 16 Jul 2022 14:24:27 -0400 Received: by mail-ej1-f46.google.com with SMTP id j22so14323751ejs.2 for <56604@debbugs.gnu.org>; Sat, 16 Jul 2022 11:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20210112.gappssmtp.com; s=20210112; h=from:to:subject:in-reply-to:references:message-id:date:mime-version; bh=87jUbURBT3Q3T03QzoFqRaiZ0rtTjz5ssH2S5ERXMLk=; b=L49qbL9qEJivOpPIstAmzHM9DFRubCYv9HFG8FcQmGNDr7WtcduOw50lkmivpqk5Su BIynbMrJKl/knafuBNwFALoKddiNJWyDiH/Kj+ukVQSV+Vwx6fuRx9mIibZ2oHbJkUCC 4KkklFzfGEcuLJtVnXJ8yCsYTxdT2yNBeTNJpo2UcQzC2TiLI5bOewKYBECkYFGZ9Z6t Poz4zAjnVUzNP/V2rRjRwGHE9R8oMypfmaPD0m7z4JVqO0xG+jSFIl96PCnU3YG3B1Y+ 99tt0HfldcvFz6IygKed7HbOK0JiDLZZlEt+ItQpdx5EtlA9G+cwZMePhbIlY5SwkvEa XoNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references :message-id:date:mime-version; bh=87jUbURBT3Q3T03QzoFqRaiZ0rtTjz5ssH2S5ERXMLk=; b=7++V7n9/n7yu8biljW8lpkR6poRqVDH9MBWSVmusj6IxHnM/iWMZX/NQ5jrQguejeN W4VkXvTJOV58CM4vPzNd3fR9+LyLAIt6vxN1Wp4aTSM+FecO0REXVI9qrcAoYRU+FFFT hdSimP8E8oalslegQZcp+8cmBeKgS8KNKTt4/8vrGzyDSpFIuuN7gTQcMw8jznbq2XNe D8yqCMZq/acQ4EbEYLs/+u0px3DJnvOzxZIUZzgiODaUeK31S/9UCOw5+fUIpDWqy+uq X8yBnDM/A7bBt5q42AM5d7yuucOIuH85rcV9lH2mu4H18OjytMeL1qqsD+1qeeLv6tQe w2vQ== X-Gm-Message-State: AJIora8lp+cqDJOoRVoTi9syIvL4+3MO7g+CqokeBNxf2EJExIENVOrA IJAoeQU6Y3vD31l9E4idWzqYPqnyScsv9iDv X-Google-Smtp-Source: AGRyM1tOzN5BGeBA7OInz5edeiJGBue74Lfp0bTElcNkIi75FikkgyvedMe/2cRurB/DHvda6eklUg== X-Received: by 2002:a17:906:8472:b0:72b:5088:be7b with SMTP id hx18-20020a170906847200b0072b5088be7bmr19164741ejc.164.1657995860296; Sat, 16 Jul 2022 11:24:20 -0700 (PDT) Received: from thinkpad (tmo-117-210.customers.d1-online.com. [80.187.117.210]) by smtp.gmail.com with ESMTPSA id 4-20020a170906308400b0071cef6c53aesm3449909ejv.0.2022.07.16.11.24.19 for <56604@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jul 2022 11:24:19 -0700 (PDT) From: r0man In-Reply-To: References: Message-Id: <57f679a137761bd5954850c2cb2c5c3cd7055fac.1657994905.git.roman@burningswell.com> Date: Sat, 16 Jul 2022 20:24:18 +0200 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sat, 16 Jul 2022 14:32:24 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657996394; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=87jUbURBT3Q3T03QzoFqRaiZ0rtTjz5ssH2S5ERXMLk=; b=f5/rPV33zCQhYNy2RNE7vPgeZPqIAY6g/0onwKqZsaL26pjH0iXPlC+1eJitXe/9CfWgCf xLHlx9FJlEimjRRJppzTpK9bWrQxtBFsAn4BV48CRrab0Z8CS3IWUBXs1zsmbqSWLjtvJf XVP8FGqc1n5dQmXajGn85JbCTC3g1KpciI/2xnRt7N01f+hu7U2kddJ+w6J1cmwdqB3dBf rKtwTM0AlimL0O52nEJavBWGdMmxNIMR0/IBxboyJxTQgz+XZ93GKuxjQv6dD8mKbh1vMi UyvyOG+YvaLwP5PVGOX8lidcl0EGtvpgz8b/8tjQSFqpX/Be8JCidyde/RK0+A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657996394; a=rsa-sha256; cv=none; b=rfUMdtUzp0pozwx3mwXxD28JK8itP8IVoik+FS6Sjzl7ZDdOK5njAW+ixvKVObUgo3TBlE lTeqa1qi2ze2IAeJO2rjMVmHSlbjZGBFs/N3rdffxyYYZNXgfhmRjZk2J/AEYpWPJa8ssc lwve3qt9jTd23tZRYKUUJboYAi3J+/jbcYoIMIwgaWflRJvx5TkJOyX5gj4Ya65md5IYGv lq8sV8K3cGRXPXf9RVgLjB3CNve3TNNSvTwFApFXQu0KZ7NHIIHCGf2WsrYiwn6MR2jnzl VNBGblwDfLgzD5TdrWotQl4MytGwSLFlsPmz99lqNAhtF0USXOJ5/EIl2CwiZg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=burningswell-com.20210112.gappssmtp.com header.s=20210112 header.b=L49qbL9q; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.14 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=burningswell-com.20210112.gappssmtp.com header.s=20210112 header.b=L49qbL9q; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 2E9D636A86 X-Spam-Score: -1.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: OryKgOOMRLDa --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable This patch updates Clojure to 1.11.1. It also adds the 'reset-class-timesta= mps phase to the Clojure build system. This phase makes sure the timestamp of compiled class files is set to a lat= er point in time than the timestamp of the corresponding Clojure source files.= If the timestamps of the class and source files are the same, the Clojure compiler will compile the sources again which can lead to issues. This prob= lem has been discussed here [1]. The suggested solution was to keep/adjust the timestamps of the class files. [1] https://www.mail-archive.com/clojure@googlegroups.com/msg99928.html =2D-- gnu/packages/clojure.scm | 93 ++++++++++++++++++++++------- guix/build/clojure-build-system.scm | 53 +++++++++++++++- 2 files changed, 123 insertions(+), 23 deletions(-) diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm index fa201f3110..d51923acdb 100644 =2D-- a/gnu/packages/clojure.scm +++ b/gnu/packages/clojure.scm @@ -43,36 +43,44 @@ (define-public clojure ;; The libraries below are needed to run the tests. (libraries `(("core-specs-alpha-src" =2D ,(lib "core.specs.alpha/archive/core.specs.alpha-" =2D "0.1.24" =2D "0v2a0svf1ar2y42ajxwsjr7zmm5j7pp2zwrd2jh3k7xzd1p9x1fv= ")) + ,(lib "core.specs.alpha/archive/v" + "0.2.62" + "0v6nhghsigpzm8y7dykfm318q5dvk5l8sykmn1hr0qgs1jsjqh9j")) ("data-generators-src" ,(lib "data.generators/archive/data.generators-" =2D "0.1.2" =2D "0kki093jp4ckwxzfnw8ylflrfqs8b1i1wi9iapmwcsy328dmgzp1= ")) + "1.0.0" + "0s3hf1njvs68b8igasikvzagzqxl0gbri7w2qhzsypkhfh60v2cp")) + ("java-classpath-src" + ,(lib "java.classpath/archive/java.classpath-" + "1.0.0" + "178zajjsc9phk5l61r8w9hcpk0wgc9a811pl7kjgvn7rg4l7fh7j")) ("spec-alpha-src" =2D ,(lib "spec.alpha/archive/spec.alpha-" =2D "0.1.143" =2D "00alf0347licdn773w2jarpllyrbl52qz4d8mw61anjksacxylzz= ")) + ,(lib "spec.alpha/archive/v" + "0.3.218" + "0h5nd9xlind1a2vmllr2yfhnirgj2pm5dndgqzrly78l5iwcc3wa")) ("test-check-src" =2D ,(lib "test.check/archive/test.check-" =2D "0.9.0" =2D "0p0mnyhr442bzkz0s4k5ra3i6l5lc7kp6ajaqkkyh4c2k5yck1md= ")) + ,(lib "test.check/archive/v" + "1.1.1" + "0kx8l79mhpnn94rpsgc7nac7gb222g7a47mzrycj8crfc54wf0c1")) ("test-generative-src" ,(lib "test.generative/archive/test.generative-" =2D "0.5.2" =2D "1pjafy1i7yblc7ixmcpfq1lfbyf3jaljvkgrajn70sws9xs7a9f8= ")) + "1.0.0" + "0yy2vc38s4j5n94jdcjx1v7l2gdq0lywam31id1jh07sx37lv5il")) ("tools-namespace-src" ,(lib "tools.namespace/archive/tools.namespace-" =2D "0.2.11" =2D "10baak8v0hnwz2hr33bavshm7y49mmn9zsyyms1dwjz45p5ymhy0= ")))) + "1.0.0" + "1ifpk93m33rj2xm1qnnninlsdvm1liqmsp9igr63pjjwwwjw1cnn")) + ("tools-reader-src" + ,(lib "tools.reader/archive/tools.reader-" + "1.3.2" + "1n4dhg61iyypnjbxmihhqjb7lfpc0lzfvlk4jd8w0yr6za414f3a")= ))) (library-names (match libraries (((library-name _) ...) library-name)))) =20 (package (name "clojure") =2D (version "1.10.0") + (version "1.11.1") (source (let ((name+version (string-append name "-" version))) (origin (method git-fetch) @@ -81,18 +89,23 @@ (define-public clojure (commit name+version))) (file-name (string-append name+version "-checkout")) (sha256 =2D (base32 "1kcyv2836acs27vi75hvf3r773ahv2nlh9b3j9xa9m9s= danz1h83"))))) + (base32 "1xbab21rm9zvhmw1i2h5lqm7612vrdkxprq0rgb2i3sbgs= xcdsn4"))))) (build-system ant-build-system) (inputs `(("jre" ,icedtea))) (arguments `(#:imported-modules ((guix build clojure-utils) + (guix build clojure-build-system) (guix build guile-build-system) ,@%ant-build-system-modules) #:modules ((guix build ant-build-system) + ((guix build clojure-build-system) #:prefix clj:) (guix build clojure-utils) (guix build java-utils) (guix build utils) + (guix build syscalls) + (ice-9 match) + (ice-9 regex) (srfi srfi-26)) #:test-target "test" #:phases @@ -106,22 +119,60 @@ (define (extract-library name) "--extract" "--verbose" "--file" (assoc-ref inputs name) =2D "--strip-components=3D1")) =2D (copy-recursively (string-append name "/src/main/clojur= e/") =2D "src/clj/")) + "--strip-components=3D1"))) (for-each extract-library ',library-names) + (copy-recursively "core-specs-alpha-src/src/main/clojure" + "src/clj/") + (copy-recursively "spec-alpha-src/src/main/clojure" + "src/clj/") #t)) (add-after 'unpack-library-sources 'fix-manifest-classpath (lambda _ (substitute* "build.xml" (("") "")) #t)) + (add-after 'unpack-library-sources 'clojure-spec-skip-macros + ;; Disable spec macro instrumentation when compiling clojure.= spec + ;; See: https://clojure.atlassian.net/browse/CLJ-2254 + (lambda _ + (substitute* "build.xml" + (("") + ,(string-join + '("" + "\n") + "\n"))) + #t)) + (add-after 'unpack-library-sources 'clojure-spec-compile + ;; Compile and include clojure.spec.alpha & clojure.core.spec= s.alpha + (lambda _ + (substitute* "build.xml" + (("") + ,(string-join + '("" + "" + "" + "" + "")))) + #t)) + (add-before 'build 'maven-classpath-properties + (lambda _ + (define (make-classpath libraries) + (string-join (map (lambda (library) + (string-append library "/src/main/clo= jure")) + libraries) ":")) + (with-output-to-file "maven-classpath.properties" + (lambda () + (let ((classpath (make-classpath ',library-names))) + (display (string-append "maven.compile.classpath=3D" = classpath "\n")) + (display (string-append "maven.test.classpath=3D" cla= sspath "\n"))))) + #t)) (add-after 'build 'build-javadoc ant-build-javadoc) (replace 'install (install-jars "./")) (add-after 'install-license-files 'install-doc (cut install-doc #:doc-dirs '("doc/clojure/") <...>)) (add-after 'install-doc 'install-javadoc =2D (install-javadoc "target/javadoc/"))))) + (install-javadoc "target/javadoc/")) + (add-after 'reset-gzip-timestamps 'reset-class-timestamps clj:r= eset-class-timestamps)))) (native-inputs libraries) (home-page "https://clojure.org/") (synopsis "Lisp dialect running on the JVM") diff --git a/guix/build/clojure-build-system.scm b/guix/build/clojure-build= -system.scm index 7d494078ea..82440e3b7a 100644 =2D-- a/guix/build/clojure-build-system.scm +++ b/guix/build/clojure-build-system.scm @@ -22,11 +22,15 @@ (define-module (guix build clojure-build-system) ant-build)) #:use-module (guix build clojure-utils) #:use-module (guix build java-utils) + #:use-module (guix build syscalls) #:use-module (guix build utils) + #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (%standard-phases =2D clojure-build)) + clojure-build + reset-class-timestamps)) =20 ;; Commentary: ;; @@ -108,6 +112,50 @@ (define* (check #:key jar-names))) #t) =20 +(define (regular-jar-file-predicate file stat) + "Predicate returning true if FILE is ending on '.jar' +and STAT indicates it is a regular file." + (and ((file-name-predicate "\\.jar$") file stat) + (eq? 'regular (stat:type stat)))) + +(define* (reset-class-timestamps #:key outputs #:allow-other-keys) + "Unpack all jar archives, reset the timestamp of all contained class fil= es, +and repack them. This is necessary to ensure that archives are reproducib= le." + (define (repack-archive jar) + (format #t "resetting class timestamps and repacking ~a\n" jar) + (let* ((early-1980 315619200) ; 1980-01-02 UTC + (dir (mkdtemp! "jar-contents.XXXXXX")) + (manifest (string-append dir "/META-INF/MANIFEST.MF"))) + (with-directory-excursion dir + (invoke "jar" "xf" jar)) + (delete-file jar) + (for-each (lambda (file) + (let ((s (lstat file))) + (unless (eq? (stat:type s) 'symlink) + (when (string-match "^(.*)\\.class$" file) + (utime file early-1980 early-1980))))) + (find-files dir #:directories? #t)) + ;; The jar tool will always set the timestamp on the manifest file + ;; and the containing directory to the current time, even when we + ;; reuse an existing manifest file. To avoid this we use "zip" + ;; instead of "jar". It is important that the manifest appears + ;; first. + (with-directory-excursion dir + (let* ((files (find-files "." ".*" #:directories? #t)) + ;; To ensure that the reference scanner can detect all + ;; store references in the jars we disable compression + ;; with the "-0" option. + (command (if (file-exists? manifest) + `("zip" "-0" "-X" ,jar ,manifest ,@files) + `("zip" "-0" "-X" ,jar ,@files)))) + (apply invoke command))) + (utime jar 0 0))) + (for-each (match-lambda + ((output . directory) + (for-each repack-archive + (find-files directory regular-jar-file-predicate)= ))) + outputs)) + (define-with-docs install "Standard 'install' phase for clojure-build-system." (install-jars "./")) @@ -119,7 +167,8 @@ (define-with-docs %standard-phases (replace 'build build) (replace 'check check) (replace 'install install) =2D (add-after 'install-license-files 'install-doc install-doc))) + (add-after 'install-license-files 'install-doc install-doc) + (add-after 'reset-gzip-timestamps 'reset-class-timestamps reset-class-= timestamps))) =20 (define* (clojure-build #:key inputs =2D-=20 2.36.1 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFLBAEBCAA1FiEE0iajOdjfRIFd3gygPdpSUn0qwZkFAmLTAlIXHHJvbWFuQGJ1 cm5pbmdzd2VsbC5jb20ACgkQPdpSUn0qwZmwEgf/dEVhn6c78eJSAd5XdntZmGug SKo7iatyggVjsDZHqDSlO278+/Z+DXYY4ushbJGibXi3YCMk7s72TVqkBFc9GDH6 oAlPQKHhfSh6HQCoNLqZLlz9BoTtfwJZ1LS411SL/O+R8TZUQd31FICWy0sHdXrQ riC/T479l70elfxh6NchhakmI8zU//mM843gbe/OHGZDqVj/tHTAPO1W1saKkXnm 2UZB5hcZGqILKQ1MavIyunPQ81QA2kKdLR71/izICfe33rc1mXiiNwA2YIVKRBt8 +vUhx1LMDUPKH6kxtaofE3n0I48y27UHbznP+IRfUPX4eWo49liodS0loZNTcg== =7ZSZ -----END PGP SIGNATURE----- --=-=-=--