[Reproducible-builds] Minimising work needed for this build-path issue

HW42 hw42 at ipsumj.de
Mon Sep 5 19:36:00 UTC 2016


Ximin Luo:
> However the question is, do we want to do this every time an upstream
> saves CFLAGS somewhere?
[...]
> 2. Define another variable SOURCE_ROOT to be set to the top-level
> source dir, and patch GCC to use this as the default value for
> debug-prefix-map (and the analogue for other languages / tools).
> 
> This would have the same concrete behaviour as the current situation,
> but then we're defining yet another variable... but probably less
> tools will need to support this than SOURCE_DATE_EPOCH. And as with
> (1), this would not be necessary for the path-is-namespace languages.

This is to some extend already possible with with gcc (Thanks to guillem
for the idea). Add '-specs /usr/.../rb.spec' to CFLAGS and then set
inside the specs file debug-prefix-map based on an env var:

  *cc1_options:
  + -fdebug-prefix-map=%:getenv(SOURCE_ROOT =.)

Unfortunately this is not that easy. The getenv function fails hard if
the env var is not set. And since the build environment for Debian
packages is mostly unconstrained there seems to be no way to guarantee
that this variable is always set.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 825 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20160905/8455d80f/attachment.sig>


More information about the Reproducible-builds mailing list