Use the provider enum to tie-break sorting by function provider name.

Without this, we got code generation that was dependent on the
original ordering in the hash table, and thus non-reproducible builds.

Based on a commit by Stephan Kulow, but retaining the sorting by
function name first (that way all providers with the same name appear
next to each other like before, and also happens to ensure that core
names tend to appear before non-core names)
macos/v1.5.9
Eric Anholt 10 years ago
parent b9fbcaf0e2
commit 136cf85424
  1. 2
      src/gen_dispatch.py

@ -566,7 +566,7 @@ class Generator(object):
providers.append(provider) providers.append(provider)
def provider_sort(provider): def provider_sort(provider):
return (provider.name != func.name, provider.name) return (provider.name != func.name, provider.name, provider.enum)
providers.sort(key=provider_sort); providers.sort(key=provider_sort);
if len(providers) != 1: if len(providers) != 1:

Loading…
Cancel
Save