[Mesa-dev] [PATCH] anv_icd.py: improve reproducible builds
Frank Richter
frank.richter at dynardo.de
Fri Jan 26 09:48:39 UTC 2018
On 26.01.2018 09:56, Maxin B. John wrote:
>>> @@ -44,4 +44,4 @@ if __name__ == '__main__':
>>> }
>>>
>>> with open(args.out, 'w') as f:
>>> - json.dump(json_data, f, indent = 4)
>>> + json.dump(json_data, f, indent = 4, sort_keys=True)
>>
>> I'm slightly confused what exactly causes the issue.
>> Please shed some light so we can add it to the commit message.
As nobody answered earlier...
Python dicts do not guarantee any key order at all.
Practically, I think the order depends on the hash value of the key -
but, since Python uses a different hash seed every time (security
reasons or so), the hash values change every time, and thus any order of
the keys changes as well.
Sorting keys obviously guarantees a specific order.
-f.r.
More information about the mesa-dev
mailing list