Subject: bug#58591: Java packages do not appear to keep a reference to their inputs

From: Maxim Cournoyer <[email-masked]>
Date: Tue, 18 Oct 2022 09:29:48 -0400

Hi,

Maxim Cournoyer <[email-masked]> writes:

[...]

> A nice read is [0], which mentions the existence of a 'Class-Path' main
> attribute that can go in the manifest file.  If using unpacked jars
> works the same as .jars (which are just zip files) for Java, then we
> could not only have dependency correctly referenced and loaded via
> 'Class-Path', but also the grafting mechanism would work, since the
> paths would appear in clear (not obfuscated due to zip compression).

Ugh, Class-Path only accepts relative path, not absolute paths:

   The location of the JAR file or directory represented by this entry
   is contained within the containing directory of the context JAR. Use
   of "../" to navigate to the parent directory is not permitted, except
   for the case when the context JAR is loaded from the file system.

Perhaps we could patch Java so that it's loader is more adapted for our
use case, or extend its manifest with a Guix-specific Guix-Class-Path
section that'd allow for absolute paths.

> [0] https://docs.oracle.com/en/java/javase/19/docs/specs/jar/jar.html

-- 
Thanks,
Maxim