From 136cf854248118b1f2e3582df868cdecd1d5fb7b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Jun 2015 17:19:07 -0700 Subject: [PATCH] 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) --- src/gen_dispatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py index ab526ef..92f6358 100755 --- a/src/gen_dispatch.py +++ b/src/gen_dispatch.py @@ -566,7 +566,7 @@ class Generator(object): providers.append(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); if len(providers) != 1: