← Back to team overview

openjdk team mailing list archive

Bug#944738: jlink: Hash of module differs to expected hash recorded in java.base

 

tags 944738 patch
thanks

On Thu, Sep 17, 2020 at 06:45:39PM +0100, Julian Gilbey wrote:
> affects 944738 openjdk-14-jdk
> thanks
> 
> The same problem is still present in openjdk-14 - see
> https://bugs.debian.org/968991

I have located the source of the bug and have a patch to fix it.

The cause is the use of dh_strip_nondeterminism late in the build
process.  This reorganises the jmod files, which in turn changes their
SHA256 checksums.  This would not be a problem, except that the
checksums are saved in java.base.jmod *before* the use of
dh_strip_nondeterminism.  Performing this stripping immediately after
each jmod file is created results in the checksums being consistent
throughout.

To do this:

* add the attached patch to debian/patches (and to the quilt patch
  series); this calls strip-nondeterminism whenever a jmod file is
  created

* add the strip-nondeterminism package as a Build-Depends

* optionally add "-Xjmods" to the dh_strip_nondeterminism call on line
  1781 (or thereabouts) of debian/rules (within the binary-arch
  target) - this is optional, because applying strip-nondeterminism a
  second time should not change anything.

Of course, to make the patch more generally applicable, one could add
a check for strip-nondeterminism into the configure script, etc., but
for a debian-specific build, that does not seem to be necessary.

Incidentally, the check for the existence of dh_strip_nondeterminism
in debian/rules is unnecessary, as debhelper Depends on
dh-strip-nondeterminism, and has done since version 9.20151004.

Best wishes,

   Julian


Follow ups

References