summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Marler <johnnymarler@gmail.com>2019-09-19 15:34:34 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-19 22:36:57 +0100
commit61c41369003444bfbf1c45e7cfd2752a4b7bc22f (patch)
treedd33aedac979d829eda900f87b12746b47bb572c
parent95ad5626296380358c8a502a3e04879dab653d78 (diff)
downloadopenembedded-core-contrib-61c41369003444bfbf1c45e7cfd2752a4b7bc22f.tar.gz
package: Multiple shlib_providers for the same file should error
In the case where multiple packages provide the same file, we show an error. Otherwise, python will generate a different build depending on which provider appears first in the dictionary. On my system this order changes every time I run bitbake causing intermittent build differences. Add a sorted() to fix the determinism issue too. Signed-off-by: Jonathan Marler <johnnymarler@hp.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/package.bbclass21
1 files changed, 11 insertions, 10 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index aa8451ffe8..d8bef3afb0 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1580,6 +1580,7 @@ SHLIBSDIRS = "${WORKDIR_PKGDATA}/${MLPREFIX}shlibs2"
SHLIBSWORKDIR = "${PKGDESTWORK}/${MLPREFIX}shlibs2"
python package_do_shlibs() {
+ import itertools
import re, pipes
import subprocess
@@ -1835,16 +1836,16 @@ python package_do_shlibs() {
bb.debug(2, '%s: Dependency %s covered by PRIVATE_LIBS' % (pkg, n[0]))
continue
if n[0] in shlib_provider.keys():
- shlib_provider_path = []
- for k in shlib_provider[n[0]].keys():
- shlib_provider_path.append(k)
- match = None
- for p in list(n[2]) + shlib_provider_path + libsearchpath:
- if p in shlib_provider[n[0]]:
- match = p
- break
- if match:
- (dep_pkg, ver_needed) = shlib_provider[n[0]][match]
+ shlib_provider_map = shlib_provider[n[0]]
+ matches = set()
+ for p in itertools.chain(list(n[2]), sorted(shlib_provider_map.keys()), libsearchpath):
+ if p in shlib_provider_map:
+ matches.add(p)
+ if len(matches) > 1:
+ matchpkgs = ', '.join([shlib_provider_map[match][0] for match in matches])
+ bb.error("%s: Multiple shlib providers for %s: %s (used by files: %s)" % (pkg, n[0], matchpkgs, n[1]))
+ elif len(matches) == 1:
+ (dep_pkg, ver_needed) = shlib_provider_map[matches.pop()]
bb.debug(2, '%s: Dependency %s requires package %s (used by files: %s)' % (pkg, n[0], dep_pkg, n[1]))