all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: JARs and reference scanning
Date: Tue, 25 Apr 2017 22:34:02 -0700	[thread overview]
Message-ID: <8760hr7mwl.fsf@gmail.com> (raw)
In-Reply-To: <b1688120-ac7c-3012-bd3d-a19c622d6a96@crazy-compilers.com> (Hartmut Goebel's message of "Tue, 25 Apr 2017 21:28:45 +0200")

[-- Attachment #1: Type: text/plain, Size: 3370 bytes --]

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Am 24.04.2017 um 00:57 schrieb Chris Marusich:
>> Chris Marusich <cmmarusich@gmail.com> writes:
>>
>>> Speaking of JAR files, shouldn't we try to avoid them entirely?  My
>>> understanding is that they are compressed files, which means the Guix
>>> daemon won't be able to scan them for references.  I don't know if it's
>>> easy to use Maven to build a project without putting the build output
>>> into a JAR file, though.
>> For the record, I looked into this a little more.  I was mistaken: JAR
>> files are not necessarily compressed.  In fact, it seems [1][2] that it
>> should always be possible to make un-compressed JARs.  So, perhaps the
>> Guix daemon will not have trouble scanning JARs for references, after
>> all.  (Whether or not any references will actually be retained in the
>> JARs produced by Maven is another question; I don't know the answer.)
>
> I have to admit that I do not know at all how the reference scanning and
> dependency-tracking in the store works.

As I understand it, the mechanism used by the Guix daemon (and the Nix
daemon) for scanning references doesn't work when the output of a
derivation is scrambled in some way (e.g. compressed).  Therefore, if we
use JAR files, they should not be compressed.

> Regarding the jar-files ny understanding is:
>
> - JAR-files are Zip-files with additional data (as Ricardo already stated)
> - Zip-files can be used to store data without compressions (I assume
> this is what you are refering to).
> - My experience is that the contents of the JAR file can also be
> *unpacked* into the file-system, so not archives would be needed. Some
> Java guy might know better. I'm not sure it this is desired at all, though.
> - My understanding is that Java normally does not have any reference
> from one package (or jar-file) to another one. There is no such thing
> like "rpath" but is more like Python or Perl where the garbage collector
> AFAIK can not track references either.

I don't think it's necessary to unpack them, as long as we can ensure
they are not compressed.

> - According to [3, 2] the MANIFEST.INF file *may* specify a Class-Path
> containing the relative paths to other Jar-files. If this would help
> we *could* add references here, but the entry-length is limited to
> 65353 bytes, so we might hit this limit with the long paths of the
> store.  - Fedora forbids to use this Class-Path entry in MANIFEST
> files [1].  - If it helps the garbage collector, we could add some
> ".dependencies" file alongside each Java package. But we don't do this
> for Python or Perl, either.

That's an interesting idea.  This would certainly make it clear which
Java packages depend on which other packages (e.g., for garbage
collection purposes), but this wouldn't by itself help Java (or Python,
or Perl, etc.) actually find the classes.  Some other stuff (propagation
of inputs like we do with Python libraries, a Guix-managed CLASSPATH, a
custom ClassLoader, etc.) would probably be needed to ensure that Java
would be able to find the classes.

Thank you for your work on this.  It's easy for me to just give
opinions, but you've actually done the real work.  If I can find more
time, I will try to look at what you've submitted to the list and help.

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2017-04-26  5:34 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-13 11:29 Need help from Java-developers Hartmut Goebel
2017-04-23  8:41 ` Chris Marusich
2017-04-23 22:57   ` Chris Marusich
2017-04-25 19:28     ` JARs and reference scanning (was: Need help from Java-developers) Hartmut Goebel
2017-04-26  5:34       ` Chris Marusich [this message]
2017-04-26 11:53         ` store reference detection (was Re: JARs and reference scanning) Thomas Danckaert
2017-04-26 19:31           ` Maxim Cournoyer
2017-04-27 13:46           ` Ludovic Courtès
2017-04-27 14:14             ` store reference detection Thomas Danckaert
2017-04-27 17:46             ` store reference detection (was Re: JARs and reference scanning) Hartmut Goebel
2017-05-02 12:43               ` Ludovic Courtès
2017-05-07 12:48                 ` Hartmut Goebel
2017-05-07 20:23                   ` Chris Marusich
2017-05-08  7:06                     ` Ricardo Wurmus
2017-05-08 14:11                       ` Ludovic Courtès
2017-05-11  8:41                       ` Chris Marusich
2017-05-11 11:27                         ` Ricardo Wurmus
2017-05-12  6:54                           ` Chris Marusich
2017-05-12  8:21                             ` Ricardo Wurmus
2017-05-12  9:35                         ` Hartmut Goebel
2017-05-12 18:22                           ` Mark H Weaver
2017-05-12 20:05                             ` Hartmut Goebel
2017-05-12 21:24                               ` Mark H Weaver
2017-05-12  6:18                   ` Mark H Weaver
2017-05-12  8:19                     ` Chris Marusich
2017-05-12  9:46                       ` store reference detection Hartmut Goebel
2017-05-12 17:39                       ` store reference detection (was Re: JARs and reference scanning) Mark H Weaver
2017-05-12 18:27                         ` Leo Famulari
2017-05-12 19:54                         ` Hartmut Goebel
2017-05-12 21:51                           ` Mark H Weaver
2017-05-13  7:15                             ` Hartmut Goebel
2017-05-23  7:29                               ` Chris Marusich
2017-04-25  8:44   ` Need help from Java-developers Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760hr7mwl.fsf@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=h.goebel@crazy-compilers.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.