summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-10 22:31:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-10 22:45:21 +0000
commit58e05020e09971f05effb79f8f1eb2012df4f0db (patch)
treed02858369787901dff7379e1ae2de1d64b594ac3 /bitbake/lib
parent4137923598e2c1f9e4e54a3bf0f98b823fd54ff1 (diff)
downloadpoky-58e05020e09971f05effb79f8f1eb2012df4f0db.tar.gz
bitbake: providers: Fix determinism issue
We saw builds where runtime providers were sometimes changing order and the build result was therefore non-deterministic. For example it could show: DEBUG: providers for lib32-initd-functions are: ['lib32-lsbinitscripts', 'lib32-initscripts'] or DEBUG: providers for lib32-initd-functions are: ['lib32-initscripts', 'lib32-lsbinitscripts'] which could cause a test to pass or fail. This change ensures we don't rely on the random order of dictonaries in memory and act deterministically. (Bitbake rev: ebce92bf8d71f8a6e8af1c6cf6ba335faf9d67c8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/providers.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bitbake/lib/bb/providers.py b/bitbake/lib/bb/providers.py
index 443187e17f..c2aa98c065 100644
--- a/bitbake/lib/bb/providers.py
+++ b/bitbake/lib/bb/providers.py
@@ -244,17 +244,17 @@ def _filterProviders(providers, item, cfgData, dataCache):
244 pkg_pn[pn] = [] 244 pkg_pn[pn] = []
245 pkg_pn[pn].append(p) 245 pkg_pn[pn].append(p)
246 246
247 logger.debug(1, "providers for %s are: %s", item, list(pkg_pn.keys())) 247 logger.debug(1, "providers for %s are: %s", item, list(sorted(pkg_pn.keys())))
248 248
249 # First add PREFERRED_VERSIONS 249 # First add PREFERRED_VERSIONS
250 for pn in pkg_pn: 250 for pn in sorted(pkg_pn):
251 sortpkg_pn[pn] = sortPriorities(pn, dataCache, pkg_pn) 251 sortpkg_pn[pn] = sortPriorities(pn, dataCache, pkg_pn)
252 preferred_versions[pn] = findPreferredProvider(pn, cfgData, dataCache, sortpkg_pn[pn], item) 252 preferred_versions[pn] = findPreferredProvider(pn, cfgData, dataCache, sortpkg_pn[pn], item)
253 if preferred_versions[pn][1]: 253 if preferred_versions[pn][1]:
254 eligible.append(preferred_versions[pn][1]) 254 eligible.append(preferred_versions[pn][1])
255 255
256 # Now add latest versions 256 # Now add latest versions
257 for pn in sortpkg_pn: 257 for pn in sorted(sortpkg_pn):
258 if pn in preferred_versions and preferred_versions[pn][1]: 258 if pn in preferred_versions and preferred_versions[pn][1]:
259 continue 259 continue
260 preferred_versions[pn] = findLatestProvider(pn, cfgData, dataCache, sortpkg_pn[pn][0]) 260 preferred_versions[pn] = findLatestProvider(pn, cfgData, dataCache, sortpkg_pn[pn][0])