summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-10 22:31:24 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-09 14:12:09 (GMT)
commit518b1f3de509a328c5972ad8c0530270f8de8cd6 (patch)
tree5b66acf74c77c3782d9a6ac28e3bb8d56eaed759
parentff5bedcaf0a97d30ffa33ae4f090881b0fe2d37a (diff)
downloadpoky-518b1f3de509a328c5972ad8c0530270f8de8cd6.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: eddab52a4e7c49bfcdc2c26004d0bc777a1e5c25) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 443187e..c2aa98c 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])