From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjc22-0007Z0-Gg for guix-patches@gnu.org; Sat, 28 Jul 2018 23:06:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjc1y-00073k-Gi for guix-patches@gnu.org; Sat, 28 Jul 2018 23:06:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:56399) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fjc1y-00073a-Ah for guix-patches@gnu.org; Sat, 28 Jul 2018 23:06:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fjc1x-0002a6-R8 for guix-patches@gnu.org; Sat, 28 Jul 2018 23:06:01 -0400 Subject: [bug#32295] [PATCH] gnu: clojure: Fix index generation Resent-Message-ID: From: Alex ter Weele References: <20180728060845.22800-1-boskovits@gmail.com> Date: Sat, 28 Jul 2018 22:05:08 -0500 In-Reply-To: ("=?UTF-8?Q?G=C3=A1bor?= Boskovits"'s message of "Sat, 28 Jul 2018 08:29:40 +0200") Message-ID: <87d0v6rbbv.fsf@librem.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?G=C3=A1bor?= Boskovits Cc: 32295@debbugs.gnu.org G=C3=A1bor Boskovits writes: > I could use some help from someone more familiar with clojure uses. > > On current master clojure does not build, as the manifest contains > Class-Path: . > and jar -i throws exception in phase 'generate-jar-indices. > > The patch I proposed removes the classpath from the manifest. Do you > think this can interfere with normal uses of clojure? > G=C3=A1bor, I applied your patch and did the following: $ guix environment guix -- make -j4 && ./pre-inst-env guix environment --ad= -hoc icedtea clojure ... $ java -jar $GUIX_ENVIRONMENT/share/java/clojure-1.9.0.jar Clojure 1.9.0 user=3D> (inc 0) 1 user=3D> (clojure.set/difference #{1 2} #{1}) ClassNotFoundException clojure.set java.net.URLClassLoader.findClass (URLC= lassLoader.java:381) user=3D> (require 'clojure.set) nil user=3D> (clojure.set/difference #{1 2} #{1}) #{2} Constructing the environment caused Clojures's test suite to run with no failures. Based on a cursory test, I think that Clojure is working as expected. I also looked into what the removed line means. https://ant.apache.org/manual/Tasks/jar.html explains that in the "jar" task specifies an inline manifest. https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.ht= ml#classpath explains the meaning of a Class-Path in a manifest. So, I believe that means that at runtime, JARs in the same directory as the Clojure JAR will be available on the classpath. I believe that the line was added in this commit https://github.com/clojure/clojure/commit/36868a7734f15c51eb1831aa9d72a1454= 4496987#diff-2cccd7bf48b7a9cc113ff564acd802a8R30. The age of the commit and the commit message lead me to believe that it was added as a convenience during the early development of Clojure and may be removable upstream now. I may ask about that on the Clojure mailing list. > Another possible solution would be to delete the index generation > phase, but I'm not sure about the implications here either. > > WDYT? I also tried this and did the same as above. Clojure's test suite ran again and had no failures. However, generate-jar-indices in (guix build ant-build-system) has a docstring which suggests that the phase is necessary to prevent garbage collection of the dependencies of the JAR file. So it would seem like your patch is the best way to go =E2=98=BA P.S.: G=C3=A1bor, thanks for your work on Java packages recently! With a maven-build-system, I think I can bootstrap leiningen, which I'd really like to see in the distribution.