Subject: bug#32193: Java packages are indeterministic (due to order in jar?)

From: Björn Höfling <[email-masked]>
Date: Tue, 17 Jul 2018 23:09:29 +0200

/pre-inst-env  guix build --check java-eclipse-jdt-core -K
./pre-inst-env  guix build --check -K java-httpcomponents-httpcore-nio

both fail.

diffoscope /gnu/store/6r2x0fbsj9kwvljrdx2nc8nbrvd9d78m-java-eclipse-jdt-core-3.12.3 /gnu/store/6r2x0fbsj9kwvljrdx2nc8nbrvd9d78m-java-eclipse-jdt-core-3.12.3-check/  >java-eclipse-jdt-core-3.12.3_diffoscope.log

This looks like:

│ │ │ │ +org/eclipse/jdt/core/formatter
│ │ │ │  org/eclipse/jdt/core/eval
│ │ │ │ +org/eclipse/jdt/core/jdom
│ │ │ │  org/eclipse/jdt/core/dom
│ │ │ │  org/eclipse/jdt/core/dom/rewrite
│ │ │ │ -org/eclipse/jdt/core/formatter
│ │ │ │ -org/eclipse/jdt/core/jdom
│ │ │ │ -org/eclipse/jdt/core/search
│ │ │ │ -org/eclipse/jdt/core/compiler
│ │ │ │ -org/eclipse/jdt/core/compiler/batch
│ │ │ │  org/eclipse/jdt/core/index

i.e. order is wrong. Full diff attached.

In 'strip-jar-timestamps the jars are repacked the last time, with
find-files and zip.

I made some experiments: zip is sensitive to the order of inputs.

I tried some examples from a Guile-REPL with
find-files from guix/build/utils.scm, but they worked as expected,
returning files in order.

Björn