GNU bug report logs - #32295
[PATCH] gnu: clojure: Fix index generation.

Previous Next

Package: guix-patches;

Reported by: Gábor Boskovits <boskovits <at> gmail.com>

Date: Sat, 28 Jul 2018 06:10:02 UTC

Severity: normal

Tags: patch

Done: Gábor Boskovits <boskovits <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32295 in the body.
You can then email your comments to 32295 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#32295; Package guix-patches. (Sat, 28 Jul 2018 06:10:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gábor Boskovits <boskovits <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 28 Jul 2018 06:10:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gábor Boskovits <boskovits <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Gábor Boskovits <boskovits <at> gmail.com>
Subject: [PATCH] gnu: clojure: Fix index generation.
Date: Sat, 28 Jul 2018 08:08:45 +0200
* gnu/packages/java.scm (clojure)[arguments]: Add phase 'fix-manifest-classpath to remove
offending directory entry making indexing fail.
---
 gnu/packages/java.scm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 2ba6d76ca..0ff92c763 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1862,6 +1862,11 @@ new Date();"))
                   "test-generative-src"
                   "tools-namespace-src"))
                #t))
+           (add-after 'unpack 'fix-manifest-classpath
+             (lambda _
+               (substitute* "build.xml"
+                 (("<attribute name=\"Class-Path\" value=\".\"/>") ""))
+               #t))
            ;; The javadoc target is not built by default.
            (add-after 'build 'build-doc
              (lambda _
-- 
2.18.0





Information forwarded to guix-patches <at> gnu.org:
bug#32295; Package guix-patches. (Sat, 28 Jul 2018 06:30:02 GMT) Full text and rfc822 format available.

Message #8 received at 32295 <at> debbugs.gnu.org (full text, mbox):

From: Gábor Boskovits <boskovits <at> gmail.com>
To: 32295 <at> debbugs.gnu.org
Subject: [PATCH] gnu: clojure: Fix index generation
Date: Sat, 28 Jul 2018 08:29:40 +0200
[Message part 1 (text/plain, inline)]
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?

Another possible solution would be to delete the index generation phase,
but I'm not sure about the implications here either.

WDYT?
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#32295; Package guix-patches. (Sun, 29 Jul 2018 03:06:01 GMT) Full text and rfc822 format available.

Message #11 received at 32295 <at> debbugs.gnu.org (full text, mbox):

From: Alex ter Weele <alex.ter.weele <at> gmail.com>
To: Gábor Boskovits <boskovits <at> gmail.com>
Cc: 32295 <at> debbugs.gnu.org
Subject: Re: [bug#32295] [PATCH] gnu: clojure: Fix index generation
Date: Sat, 28 Jul 2018 22:05:08 -0500
Gábor Boskovits <boskovits <at> gmail.com> 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ábor,

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=> (inc 0)
1
user=> (clojure.set/difference #{1 2} #{1})
ClassNotFoundException clojure.set  java.net.URLClassLoader.findClass (URLClassLoader.java:381)
user=> (require 'clojure.set)
nil
user=> (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
<manifest> in the "jar" task specifies an inline
manifest. https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#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 <attribute name="Class-Path" value="."/> line was
added in this commit
https://github.com/clojure/clojure/commit/36868a7734f15c51eb1831aa9d72a14544496987#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 ☺

P.S.: Gábor, 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.





Information forwarded to guix-patches <at> gnu.org:
bug#32295; Package guix-patches. (Sun, 29 Jul 2018 06:39:01 GMT) Full text and rfc822 format available.

Message #14 received at 32295 <at> debbugs.gnu.org (full text, mbox):

From: Gábor Boskovits <boskovits <at> gmail.com>
To: alex.ter.weele <at> gmail.com
Cc: 32295 <at> debbugs.gnu.org
Subject: Re: [bug#32295] [PATCH] gnu: clojure: Fix index generation
Date: Sun, 29 Jul 2018 08:38:38 +0200
[Message part 1 (text/plain, inline)]
Alex ter Weele <alex.ter.weele <at> gmail.com> ezt írta (időpont: 2018. júl.
29., V, 5:05):

> Gábor Boskovits <boskovits <at> gmail.com> 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ábor,
>
> 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=> (inc 0)
> 1
> user=> (clojure.set/difference #{1 2} #{1})
> ClassNotFoundException clojure.set  java.net.URLClassLoader.findClass
> (URLClassLoader.java:381)
> user=> (require 'clojure.set)
> nil
> user=> (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.
>
>
Thanks for the review, I will apply this patch then.


> I also looked into what the removed line
> means. https://ant.apache.org/manual/Tasks/jar.html explains that
> <manifest> in the "jar" task specifies an inline
> manifest.
> https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#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 <attribute name="Class-Path" value="."/> line was
> added in this commit
>
> https://github.com/clojure/clojure/commit/36868a7734f15c51eb1831aa9d72a14544496987#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 ☺
>
> P.S.: Gábor, 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.
>
>
[Message part 2 (text/html, inline)]

Reply sent to Gábor Boskovits <boskovits <at> gmail.com>:
You have taken responsibility. (Sun, 29 Jul 2018 10:03:02 GMT) Full text and rfc822 format available.

Notification sent to Gábor Boskovits <boskovits <at> gmail.com>:
bug acknowledged by developer. (Sun, 29 Jul 2018 10:03:02 GMT) Full text and rfc822 format available.

Message #19 received at 32295-done <at> debbugs.gnu.org (full text, mbox):

From: Gábor Boskovits <boskovits <at> gmail.com>
To: 32295-done <at> debbugs.gnu.org
Subject: gnu: clojure: Fix index generation.
Date: Sun, 29 Jul 2018 12:01:51 +0200
[Message part 1 (text/plain, inline)]
Fixed on master as commit 62196859227a91a206deceaae2829d9c32308347.
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 26 Aug 2018 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 300 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.