[Debichem-devel] Bug#993674: ga: please make the build reproducible

Simon McVittie smcv at debian.org
Sat Sep 4 17:31:21 BST 2021


Source: ga
Version: 5.7.2-2
Severity: normal
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: usrmerge
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

libglobalarrays-dev gets different -L paths in the ga-config script,
depending on whether the build happens to have been done on a system
where /usr/lib64 exists.

On Debian systems, /usr/lib64 will normally exist on 64-bit systems that
have merged-/usr (via the usrmerge package or debootstrap --merged-usr),
such as systems that were installed with debian-installer as buster or
later, but will not normally exist on traditional non-merged-/usr systems.

This can be seen on the reproducible-builds.org infra, which uses
non-merged-/usr for "build 1" and merged-/usr for "build 2":
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/ga.html

If you have sbuild available, an easy way to reproduce this is to build
for amd64 twice, once with --add-depends=usrmerge and once without.

It is never necessary for Debian packages to use -L/usr/lib or -I/usr/include
explicitly, because Debian's compilers have those directories in their
default search paths. Similarly, it is never necessary for Debian packages
for "lib64" architectures like amd64 to use -L/usr/lib64 explicitly.
This means ga can be made reproducible by not specifying /usr, and instead
relying on the armci library being in the default compiler search path.

Please consider the attached patch. It does not eliminate all the unnecessary
-I/usr/include or -L/usr/lib, only the ones that can be a problem for
reproducible builds, and seems like a net simplification for the package
in general.

The changes that result in the ga-config script when applying the patch
look something like this (quoting from diffoscope output):

│ │ │ ├── ./usr/bin/ga-config
│ │ │ │ @@ -263,30 +263,30 @@
│ │ │ │  dep_libs=`$prefix/bin/armci-config --libs`
│ │ │ │  
│ │ │ │  fi
│ │ │ │  
│ │ │ │  
│ │ │ │  f77="mpif90"
│ │ │ │  cc="mpicc"
│ │ │ │ -cppflags="     -I/usr/include -I/usr/include"
│ │ │ │ -network_cppflags=" -I/usr/include"
│ │ │ │ +cppflags="     -I/usr/include"
│ │ │ │ +network_cppflags=""
│ │ │ │  cflags=""
│ │ │ │  fflags=" -fdefault-integer-8"
│ │ │ │  fint="-fdefault-integer-8"
│ │ │ │  blas_size="4"
│ │ │ │  scalapack_size="4"
│ │ │ │  use_blas="1"
│ │ │ │  use_lapack="1"
│ │ │ │  use_scalapack="1"
│ │ │ │  use_peigs="0"
│ │ │ │  use_elpa="0"
│ │ │ │  use_elpa_2015="0"
│ │ │ │  use_elpa_2016="0"
│ │ │ │ -ldflags="     -L/usr/lib64 -L/usr/lib"
│ │ │ │ -network_ldflags=" -L/usr/lib64"
│ │ │ │ +ldflags="     -L/usr/lib"
│ │ │ │ +network_ldflags=""
│ │ │ │  libs="-lga  -lscalapack-openmpi  -lopenblas  -lopenblas $dep_libs"
│ │ │ │  network_libs=" -larmci"
│ │ │ │  flibs=" -L/usr/lib/gcc/x86_64-linux-gnu/10 -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/10/../../.. -lgfortran -lm -lquadmath"
│ │ │ │  enable_f77_true=""
│ │ │ │  version="5.7.1"
│ │ │ │  
│ │ │ │  if test "x$enable_f77_true" = x; then :

    smcv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-d-rules-Don-t-specify-path-to-armci-for-reproducible.patch
Type: text/x-diff
Size: 1123 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debichem-devel/attachments/20210904/55b2617f/attachment.patch>


More information about the Debichem-devel mailing list