diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2013-09-02 09:47:21 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-09 16:27:44 +0100 |
commit | ab377c00c33a2d296bfda1b0b6c2a62b29d1004f (patch) | |
tree | 1fb405a40a9ddb68cf42c5e260e6ecb22357370f /lib/bb | |
parent | 92b624cbc2711d3d859994099fb63918dfd0031a (diff) | |
download | bitbake-ab377c00c33a2d296bfda1b0b6c2a62b29d1004f.tar.gz |
runqueue.py: check whether multiple versions of the same PN are due to be built
There would be an race issue if we:
$ bitbake make-3.81 make-3.82
This because they are being built at the same time which would cause
unexpected problems, for example:
[snip]
ERROR: Package already staged (/path/to/tmp/sstate-control/manifest-qemux86-make.populate-sysroot)?!
ERROR: Function failed: sstate_task_postfunc
[snip]
Or there would be python's strack trace such as:
[snip]
*** 0004: mfile = open(manifest)
0005: entries = mfile.readlines()
0006: mfile.close()
0007:
0008: for entry in entries:
Exception: IOError: [Errno 2] No such file or directory: xxx
[snip]
[YOCTO #5094]
We can quit earlier to avoid this kind of issue when two versions of the same PN
are going to be built since this isn't supported.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb')
-rw-r--r-- | lib/bb/runqueue.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py index 79e612e03..a86833250 100644 --- a/lib/bb/runqueue.py +++ b/lib/bb/runqueue.py @@ -696,6 +696,14 @@ class RunQueueData: prov_list[prov].append(fn) for prov in prov_list: if len(prov_list[prov]) > 1 and prov not in self.multi_provider_whitelist: + seen_pn = [] + # If two versions of the same PN are being built its fatal, we don't support it. + for fn in prov_list[prov]: + pn = self.dataCache.pkg_fn[fn] + if pn not in seen_pn: + seen_pn.append(pn) + else: + bb.fatal("Multiple versions of %s are due to be built (%s). Only one version of a given PN should be built in any given build. You likely need to set PREFERRED_VERSION_%s to select the correct version or don't depend on multiple versions." % (pn, " ".join(prov_list[prov]), pn)) msg = "Multiple .bb files are due to be built which each provide %s (%s)." % (prov, " ".join(prov_list[prov])) if self.warn_multi_bb: logger.warn(msg) @@ -703,7 +711,6 @@ class RunQueueData: msg += "\n This usually means one provides something the other doesn't and should." logger.error(msg) - # Create a whitelist usable by the stamp checks stampfnwhitelist = [] for entry in self.stampwhitelist.split(): |