#1011478 scsitools: reproducible-builds: embedded build paths in various binaries

Package:
src:scsitools
Source:
scsitools
Submitter:
Vagrant Cascadian
Date:
2022-05-23 19:30:04 UTC
Severity:
normal
Tags:
#1011478#5
Date:
2022-05-23 19:26:46 UTC
From:
To:
The build path is embedded in various binaries:

https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/scsitools.html

  /sbin/scsi-spin

  /build/1st/scsitools-0.12/debian/scsi-spin.c:290
  vs.
  /build/2/scsitools-0.12/2nd/debian/scsi-spin.c:290

The attached patch fixes this by setting -ffile-prefix-map in CFLAGS,
and explicitly passing CFLAGS to make in debian/rules. The
-ffile-prefix-map compiler flag is used to avoid embedding the absolute
path in compiled files.

Alternately, switching to use the default CFLAGS from dpkg-buildflags
(possibly through using a newer debhelper compat version) also would
include -ffile-prefix-map by default.


With this patch applied, scsitools should build reproducibly on
tests.reproducible-builds.org!


live well,
  vagrant