Skip to contentSkip to conversation

image: Fix IMAGE_FEATURES determinism issue

PATCH New Richard Purdie 1 participant 1 message May 9, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image: Fix IMAGE_FEATURES determinism issue

remain_features uses a dict which means the order is not deterministic. This can lead to the task hash changing depending on the state of the memory at parse time. This is particularly noticeable under python v3.

Since the dict is helpful in constructing the data, pass the data through sort() so the order is always deterministic.

meta/classes/image.bbclass +1 -1
index 1fb1964..a1772ad 100644
@@ -166,7 +166,7 @@ python () {
         if temp:
             bb.fatal("%s contains conflicting IMAGE_FEATURES %s %s" % (d.getVar('PN', True), feature, ' '.join(list(temp))))
 
-    d.setVar('IMAGE_FEATURES', ' '.join(list(remain_features)))
+    d.setVar('IMAGE_FEATURES', ' '.join(sorted(list(remain_features))))
 
     check_image_features(d)
     initramfs_image = d.getVar('INITRAMFS_IMAGE', True) or ""