Compiling module descriptors is not reproducible?

Remi Forax forax at univ-mlv.fr
Sat May 19 12:30:21 UTC 2018


----- Mail original -----
> De: "Alan Bateman" <Alan.Bateman at oracle.com>
> À: "org openjdk" <org.openjdk at io7m.com>, "jigsaw-dev" <jigsaw-dev at openjdk.java.net>
> Envoyé: Samedi 19 Mai 2018 13:26:55
> Objet: Re: Compiling module descriptors is not reproducible?

> On 19/05/2018 10:18, Mark Raynsford wrote:
>> Hello!
>>
>> I've been interested for a while in making all of my software builds
>> reproducible [0]. I don't think there's ever been any kind of
>> written guarantee that the output of javac will be completely
>> deterministic, but to date it seems like it actually has been. However,
>> I was a bit disappointed today to find that the output of one of the
>> builds at AdoptOpenJDK [1] seems to be inserting compiler version
>> information into compiled module descriptors. It doesn't seem to be
>> doing this for any other class files.
> The requires table in the Module attribute can be used by compilers to
> record version information about dependences. javac does record the
> version information, I don't know if there is a way to disable that. 

It seems there is no way:
http://hg.openjdk.java.net/jdk/jdk/file/5ec7380f671d/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java#l986

> In any case, I assume your question will be partly answered by looking at
> the output of `java --list-modules` on the different builds. If you
> download OpenJDK builds from jdk.java.net/10 then you should see that
> the standard and JDK-specific modules all report their version string as
> "10" or "10.0.1" as they have been built with configure options that
> make it so. At a guess, your mail may have included the output from an
> exploded (as opposed to images) build.
> 
> -Alan

Rémi


More information about the compiler-dev mailing list