Bug#965255: dh-fortran-mod: please make the output reproducible

Chris Lamb lamby at debian.org
Sat Jul 18 10:51:44 BST 2020


Source: dh-fortran-mod
Version: 0.16
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness toolchain
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0] we noticed that
dh-fortran-mod was not generating deterministic output. For example,
here is healpix-fortran's preinst file:

│ │ │ │ @@ -1,14 +1,14 @@
│ │ │ │  #!/bin/sh
│ │ │ │  set -e
│ │ │ │  # Automatically added by dh_fortran_mod/0.16
│ │ │ │  # May be installed multiple times for different canoncomp
│ │ │ │  multiarch="x86_64-linux-gnu"
│ │ │ │  base="gfortran-mod-15"
│ │ │ │ -canoncomp='gfortran-10'
│ │ │ │ +canoncomp='x86_64-linux-gnu-gfortran-9'
│ │ │ │
│ │ │ │  # clear cruft from old bug if present
│ │ │ │  rm -f /usr/lib/$multiarch/fortran/$base/$base
│ │ │ │
│ │ │ │  mkdir -p /usr/lib/$multiarch/fortran/$base
│ │ │ │  if ! test -x /usr/lib/$multiarch/fortran/$canoncomp ; then
│ │ │ │    ln -sf /usr/lib/$multiarch/fortran/$base /usr/lib/$multiarch/fortran/$canoncomp
│ │ │ │ @@ -21,15 +21,15 @@
│ │ │ │    rmdir /usr/lib/$multiarch/fortran/flang-mod-33
│ │ │ │  fi
│ │ │ │  # End automatically added section
│ │ │ │  # Automatically added by dh_fortran_mod/0.16
│ │ │ │  # May be installed multiple times for different canoncomp
│ │ │ │  multiarch="x86_64-linux-gnu"
│ │ │ │  base="gfortran-mod-15"
│ │ │ │ -canoncomp='x86_64-linux-gnu-gfortran-9'
│ │ │ │ +canoncomp='gfortran-8'
│ │ │ │
│ │ │ │  # clear cruft from old bug if present
│ │ │ │  rm -f /usr/lib/$multiarch/fortran/$base/$base
│ │ │ │
│ │ │ │  mkdir -p /usr/lib/$multiarch/fortran/$base
│ │ │ │  if ! test -x /usr/lib/$multiarch/fortran/$canoncomp ; then
│ │ │ │    ln -sf /usr/lib/$multiarch/fortran/$base /usr/lib/$multiarch/fortran/$canoncomp
│ │ │ │ @@ -42,15 +42,15 @@
│ │ │ │    rmdir /usr/lib/$multiarch/fortran/flang-mod-33
│ │ │ │  fi
│ │ │ │  # End automatically added section
│ │ │ │  # Automatically added by dh_fortran_mod/0.16
│ │ │ │  # May be installed multiple times for different canoncomp
│ │ │ │  multiarch="x86_64-linux-gnu"
│ │ │ │  base="gfortran-mod-15"
│ │ │ │ -canoncomp='gfortran-8'
│ │ │ │ +canoncomp='gfortran-10'
│ │ │ │
│ │ │ │  # clear cruft from old bug if present
│ │ │ │  rm -f /usr/lib/$multiarch/fortran/$base/$base
│ │ │ │
│ │ │ │  mkdir -p /usr/lib/$multiarch/fortran/$base
│ │ │ │  if ! test -x /usr/lib/$multiarch/fortran/$canoncomp ; then
│ │ │ │    ln -sf /usr/lib/$multiarch/fortran/$base /usr/lib/$multiarch/fortran/$canoncomp

The ordering is non-deterministic due to the main dh_fortran_mod
script iterates over a Perl dictionary in key order.

Patch attached.

  [0] https://reproducible-builds.org/


Regards,

--
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dh-fortran-mod.diff.txt
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20200718/e6133f9f/attachment-0001.txt>


More information about the debian-science-maintainers mailing list