[rb-general] rb-prefix-map spec: don't be as democratic to consumers

Ximin Luo infinity0 at debian.org
Tue Mar 21 12:32:00 CET 2017

Ximin Luo:
> Daniel Shahaf:
>> Ximin Luo wrote on Wed, Mar 15, 2017 at 09:24:00 +0000:
>>> Well, if I add too much text just to cater to minority cases or
>>> imagined future scenarios, other people would complain that it's too
>>> long. In the absence of a concrete suggestion I'll just leave it like
>>> it is.
>> I intentionally didn't offer a concrete suggestion, since I wanted us to
>> first agree on what the bug _was_ before agreeing on how to fix it, and
>> since there are several possible fixes and I didn't want to preƫmpt the
>> discussion by writing a patch that specifies one of them.  I'd be happy
>> to come up with patches, if you wish, but I think that should come later.
>> The problem in the text is simple: how can a Makefile pass a prefix-map
>> to $(CC), without knowing what the value of $(CC) is?
>> [..]
>> As to an example, how about a project foo that has subdirectories 'bar'
>> and 'bar-addons' and then adds 
>>    ${SOURCE_ROOT_DIR}/bar=bar
>> to prefix map.  That project would be reproducible if $(CC) chooses #1
>> but not if $(CC) chooses #2.  That is, it'd be reproducible with clang
>> but not with gcc.  Do you agree that it'd be better for foo to be
>> reproducible regardless of the value of $(CC)?
> I see what you mean, OK. Thanks for the example.
> I would consider this a buggy producer, to only add one directory to the map but not the other one, even though one is responsible for both directories. I'll see if I can figure out a way to explain this more precisely. In the concept that I have, when a producer "acts properly", #1 and #2 would have essentially identical behaviour.
> [..]

I tried to clarify what I mean here:


Relevant part:

+Producers that expect reproducible output MUST append at least one distinct
+mapping for each top-level directory that the build is expected to take place

Does this address your concern?

There is still the corner-case that with (1), x=/path/abc needs to be placed after y=/path/a. Not sure the most elegant way to handle that, but "producers SHOULD append the mappings in sorted order" would work.

I'll see if GCC let me change their algorithm to (2), though.


GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE

More information about the rb-general mailing list