diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-01-09 01:14:28 -0500 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-01-09 01:14:28 -0500 |
commit | ad6e0081bfd08c14a63a795ac0f74c2a302c0c94 (patch) | |
tree | c20cb3ca04d9c4f3d55f91154b9acaa3ed8d75e4 /buildstream/buildelement.py | |
parent | 12524774d4234f578d6c8b09cd13d8208d26560e (diff) | |
download | buildstream-ad6e0081bfd08c14a63a795ac0f74c2a302c0c94.tar.gz |
buildelement.py: Use a sorted dict and not an ordered one.
This change causes cache keys to be stable (without this
they are different every time due to some random order).
The input of the element does not change if you specify the
install commands before the build commands, and in any case
I dont think we can rely on knowing the order dict members
were specified in a yaml file.
Diffstat (limited to 'buildstream/buildelement.py')
-rw-r--r-- | buildstream/buildelement.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/buildstream/buildelement.py b/buildstream/buildelement.py index 2e6746ab2..486fe0bce 100644 --- a/buildstream/buildelement.py +++ b/buildstream/buildelement.py @@ -22,8 +22,6 @@ implementing the most common case of element. """ -from collections import OrderedDict - from . import Element @@ -51,12 +49,12 @@ class BuildElement(Element): pass def get_unique_key(self): - dictionary = OrderedDict() + dictionary = {} for command_name, command_list in self.commands.items(): dictionary[command_name] = command_list - return dictionary + return sorted(dictionary) def _get_commands(self, node, name): list_node = self.node_get_member(node, list, name, default_value=[]) |