[Reproducible-builds] Minimising work needed for this build-path issue
Ximin Luo
infinity0 at debian.org
Tue Sep 6 20:02:00 UTC 2016
Daniel Kahn Gillmor:
> On Wed 2016-08-24 07:20:00 -0400, Ximin Luo wrote:
>> 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.
>
> Please see:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68848
>
> in particular, this patch here:
>
> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37005
>
> See also the mild pushback from upstream about the env var
> implementation:
>
> Bernd Schmidt <bschmidt at redhat.com> wrote:
>
>>>> Wouldn't it be simpler just to special-case -fdebug-prefix-map in
>>>> gen_producer_string? The environment variable thing strikes me as
>>>> unnecessary.
>
> https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01280.html
>
> I didn't have Ximin's analysis to back up the argument for the env var
> case, and it seemed (and was) easier to just drop -fdebug-prefix-map
> From gen_producer_string.
>
> If you want to try to push this forward, i can follow up on that thread
> and ask for reconsideration of the associated patch.
>
Thanks, I did see this a while ago and forgot about it. However it does differ from the current proposal in an important way.
Current proposal (2): GCC should, if SOURCE_ROOT is set and debug-prefix-map is not given, *automatically* use this variable. There is no opportunity for the user to tell GCC to look at a different variable.
OTOH your patch above has GCC read a user-supplied variable. I think we want to avoid this, for the same reason that we pushed quite heavily for upstreams to support SOURCE_DATE_EPOCH and not their own custom command line option. It would also fix packages using gcc but not dpkg-buildflags (and for other distros, etc).
But for sure we can start from the code that you already wrote. :)
X
--
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git
More information about the Reproducible-builds
mailing list