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:14 -0800 |
commit | 97690dfe87c3c6048c96702cf8f2a77fe787fe15 (patch) | |
tree | fc8e4b5d746f7464b1c5ca01e290bd7b013596a8 /bitbake | |
parent | 4f6027c30ae2b07a238e7fec63f69169e6a70cf9 (diff) | |
download | poky-97690dfe87c3c6048c96702cf8f2a77fe787fe15.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: da85da9b58ed252c7b80a437fb5babff9e6dde48)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-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 db02a0b0de..fe01cadfde 100644 --- a/bitbake/lib/bb/providers.py +++ b/bitbake/lib/bb/providers.py | |||
@@ -245,17 +245,17 @@ def _filterProviders(providers, item, cfgData, dataCache): | |||
245 | pkg_pn[pn] = [] | 245 | pkg_pn[pn] = [] |
246 | pkg_pn[pn].append(p) | 246 | pkg_pn[pn].append(p) |
247 | 247 | ||
248 | logger.debug(1, "providers for %s are: %s", item, list(pkg_pn.keys())) | 248 | logger.debug(1, "providers for %s are: %s", item, list(sorted(pkg_pn.keys()))) |
249 | 249 | ||
250 | # First add PREFERRED_VERSIONS | 250 | # First add PREFERRED_VERSIONS |
251 | for pn in pkg_pn: | 251 | for pn in sorted(pkg_pn): |
252 | sortpkg_pn[pn] = sortPriorities(pn, dataCache, pkg_pn) | 252 | sortpkg_pn[pn] = sortPriorities(pn, dataCache, pkg_pn) |
253 | preferred_versions[pn] = findPreferredProvider(pn, cfgData, dataCache, sortpkg_pn[pn], item) | 253 | preferred_versions[pn] = findPreferredProvider(pn, cfgData, dataCache, sortpkg_pn[pn], item) |
254 | if preferred_versions[pn][1]: | 254 | if preferred_versions[pn][1]: |
255 | eligible.append(preferred_versions[pn][1]) | 255 | eligible.append(preferred_versions[pn][1]) |
256 | 256 | ||
257 | # Now add latest versions | 257 | # Now add latest versions |
258 | for pn in sortpkg_pn: | 258 | for pn in sorted(sortpkg_pn): |
259 | if pn in preferred_versions and preferred_versions[pn][1]: | 259 | if pn in preferred_versions and preferred_versions[pn][1]: |
260 | continue | 260 | continue |
261 | preferred_versions[pn] = findLatestProvider(pn, cfgData, dataCache, sortpkg_pn[pn][0]) | 261 | preferred_versions[pn] = findLatestProvider(pn, cfgData, dataCache, sortpkg_pn[pn][0]) |