[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
JARs and reference scanning (was: Need help from Java-developers)
From: |
Hartmut Goebel |
Subject: |
JARs and reference scanning (was: Need help from Java-developers) |
Date: |
Tue, 25 Apr 2017 21:28:45 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
Am 24.04.2017 um 00:57 schrieb Chris Marusich:
> Chris Marusich <address@hidden> 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.
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.
- 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.
[1]
https://fedoraproject.org/wiki/Packaging:Java#No_class-path_in_MANIFEST.MF
[2] https://en.wikipedia.org/wiki/JAR_(file_format)#Dependencies
[3]
http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Manifest
--
Regards
Hartmut Goebel
| Hartmut Goebel | address@hidden |
| www.crazy-compilers.com | compilers which you thought are impossible |
- Need help from Java-developers, Hartmut Goebel, 2017/04/13
- Re: Need help from Java-developers, Chris Marusich, 2017/04/23
- Re: Need help from Java-developers, Chris Marusich, 2017/04/23
- JARs and reference scanning (was: Need help from Java-developers),
Hartmut Goebel <=
- Re: JARs and reference scanning, Chris Marusich, 2017/04/26
- store reference detection (was Re: JARs and reference scanning), Thomas Danckaert, 2017/04/26
- Re: store reference detection (was Re: JARs and reference scanning), Maxim Cournoyer, 2017/04/26
- Re: store reference detection (was Re: JARs and reference scanning), Ludovic Courtès, 2017/04/27
- Re: store reference detection, Thomas Danckaert, 2017/04/27
- Re: store reference detection (was Re: JARs and reference scanning), Hartmut Goebel, 2017/04/27
Re: Need help from Java-developers, Ricardo Wurmus, 2017/04/25