diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-12-10 22:31:24 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-03-09 06:12:02 -0800 |
commit | fe2c3c59e3c7c98d1683a0aa81868b8696b1116b (patch) | |
tree | b0731fac1d039ef7eb4fcfd22d05cc61636a2c94 | |
parent | 5ba69a97ab5faa8f3866aaeab1d6eaa3cb8149ed (diff) | |
download | poky-fe2c3c59e3c7c98d1683a0aa81868b8696b1116b.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: 223a0f68530571d2280f526bddbc718fa803a3dc)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/providers.py | 6 |
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]) |