[bitbake-devel] [PATCH] cooker: Ensure bbappend order is deterministic

Richard Purdie richard.purdie at linuxfoundation.org
Tue Mar 29 15:09:52 UTC 2016


Currently bbappend files in a layer are applied in the order they're
found on disk (as reported by glob) which means things are not
deterministic.

By sorting the glob results, the order becomes deterministic, the parsing
order for .bb files also should be deterministic as a result of this change.

[YOCTO #9138]

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 3014697..6601dff 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1768,7 +1768,8 @@ class CookerCollectFiles(object):
                 globbed = glob.glob(f)
                 if not globbed and os.path.exists(f):
                     globbed = [f]
-                for g in globbed:
+                # glob gives files in order on disk. Sort to be deterministic.
+                for g in sorted(globbed):
                     if g not in newfiles:
                         newfiles.append(g)
 





More information about the bitbake-devel mailing list