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

Ximin Luo infinity0 at debian.org
Mon Oct 24 20:18:00 UTC 2016


Daniel Kahn Gillmor:
> On Mon 2016-10-24 15:33:00 -0400, Ximin Luo wrote:
>> HW42:
>>> Btw: Do you know why currently debug-prefix-map maps the source dir to
>>> '.'? (My guess is because that's the easiest in dpkg-buildflags) I think
>>> for debugging between package boundaries '${srcpkg}-${srcver}' would be
>>> much better.
>>>
>>> So maybe a MAP_SOURCE_PATHS variable would be better. But this has the
>>> big disadvantage of making things more complex.
>>
>> I think this idea is good in principle and we should try to aim for
>> it. My preference would be to have a second environment variable
>> though, e.g. SOURCE_ROOT_PREFIX.
>>
>> I think combining both of these envvars into one single envvar of the
>> form "$source=$target", though it matches the syntax for
>> -fdebug-prefix-map, would make it harder for other programs and build
>> tools to adopt as a standard.
> 
> Let me try to restate this cleanly.  The goal is to standardize the
> pathnames for any source-related path that gets embedded in the output
> by compilation or other build-time processing.
> 
>  SOURCE_ROOT → (optional) The full path to the base of the unpacked
>                source tree.  This will be stripped from the beginning of
>                any source-related path that makes its way into any
>                generated artifact.
>  
>  SOURCE_ROOT_PREFIX → (optional) This string is prefixed to the
>                       beginning of any source-related path that makes
>                       its way into any generated artifact.
> 
> 
> SOURCE_ROOT path mangling takes place before SOURCE_ROOT_PREFIX path
> mangling.
> 
> Is that the current proposal?
> 

Almost, with two minor corrections:

I picked SOURCE_ROOT_DIR; SOURCE_ROOT has 6395 pages of results in sources.debian.net and I didn't want to check that none of these are environment variables.

SOURCE_ROOT_PREFIX would only be prepended if SOURCE_ROOT_DIR is set and was stripped. It's not prepended to all paths; and setting it by itself without SOURCE_ROOT_DIR wouldn't do anything (since nothing gets stripped in that case).

I would also say "absolute path" instead of "source-related path" since the latter could be misinterpreted to exclude intermediate build files.

X

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git



More information about the Reproducible-builds mailing list