mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
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>
This commit is contained in:
@@ -244,17 +244,17 @@ def _filterProviders(providers, item, cfgData, dataCache):
|
|||||||
pkg_pn[pn] = []
|
pkg_pn[pn] = []
|
||||||
pkg_pn[pn].append(p)
|
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
|
# First add PREFERRED_VERSIONS
|
||||||
for pn in pkg_pn:
|
for pn in sorted(pkg_pn):
|
||||||
sortpkg_pn[pn] = sortPriorities(pn, dataCache, pkg_pn)
|
sortpkg_pn[pn] = sortPriorities(pn, dataCache, pkg_pn)
|
||||||
preferred_versions[pn] = findPreferredProvider(pn, cfgData, dataCache, sortpkg_pn[pn], item)
|
preferred_versions[pn] = findPreferredProvider(pn, cfgData, dataCache, sortpkg_pn[pn], item)
|
||||||
if preferred_versions[pn][1]:
|
if preferred_versions[pn][1]:
|
||||||
eligible.append(preferred_versions[pn][1])
|
eligible.append(preferred_versions[pn][1])
|
||||||
|
|
||||||
# Now add latest versions
|
# 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]:
|
if pn in preferred_versions and preferred_versions[pn][1]:
|
||||||
continue
|
continue
|
||||||
preferred_versions[pn] = findLatestProvider(pn, cfgData, dataCache, sortpkg_pn[pn][0])
|
preferred_versions[pn] = findLatestProvider(pn, cfgData, dataCache, sortpkg_pn[pn][0])
|
||||||
|
|||||||
Reference in New Issue
Block a user