aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-10 22:31:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-09 06:11:11 -0800
commitda85da9b58ed252c7b80a437fb5babff9e6dde48 (patch)
tree31afb1c93a0a14a9ba8556e9e274607d8ac04188
parent894814cca59f14b0f808680ea8fdf63063f01e7d (diff)
downloadbitbake-1.32.zip
bitbake-1.32.tar.gz
bitbake-1.32.tar.bz2
providers: Fix determinism issue1.32
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/providers.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bb/providers.py b/lib/bb/providers.py
index db02a0b..fe01cad 100644
--- a/lib/bb/providers.py
+++ b/lib/bb/providers.py
@@ -245,17 +245,17 @@ def _filterProviders(providers, item, cfgData, dataCache):
pkg_pn[pn] = []
pkg_pn[pn].append(p)
- logger.debug(1, "providers for %s are: %s", item, list(pkg_pn.keys()))
+ logger.debug(1, "providers for %s are: %s", item, list(sorted(pkg_pn.keys())))
# First add PREFERRED_VERSIONS
- for pn in pkg_pn:
+ for pn in sorted(pkg_pn):
sortpkg_pn[pn] = sortPriorities(pn, dataCache, pkg_pn)
preferred_versions[pn] = findPreferredProvider(pn, cfgData, dataCache, sortpkg_pn[pn], item)
if preferred_versions[pn][1]:
eligible.append(preferred_versions[pn][1])
# Now add latest versions
- for pn in sortpkg_pn:
+ for pn in sorted(sortpkg_pn):
if pn in preferred_versions and preferred_versions[pn][1]:
continue
preferred_versions[pn] = findLatestProvider(pn, cfgData, dataCache, sortpkg_pn[pn][0])