Skip to contentSkip to conversation

check whether multiple versions of the same PN are due

PATCH In review Robert Yang 2 participants 3 messages Sep 2, 2013 – Sep 9, 2013

lore
Share & tools
lore
#0 lore raw

cover check whether multiple versions of the same PN are due

This is used for fixing such a race issue:

$ bitbake make-3.81 make-3.82

There would be unexpected errors in the past, now, it will print the error message and exit:

ERROR: Multiple .bb files are due to be built which each provide make (xxx)
This usually means one provides something the other doesn't and should.
ERROR: Multiple versions of make are due to be built.

Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

// Robert

The following changes since commit c7994f83baa678a4670472e1f037bfc16cb1e3be:

bitbake: runqueue: Fix scenequeue to pass file descriptors, not a float (2013-09-02 09:16:24 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib robert/same_pn
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/same_pn

Robert Yang (1):
runqueue.py: check whether multiple versions of the same PN are due to be built

 bitbake/lib/bb/runqueue.py |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 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]

I think that we can quite earlier to fix the problem.

---
 bitbake/lib/bb/runqueue.py |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
bitbake/lib/bb/runqueue.py +11 -1
index 0700a5b..c77cb85 100644
@@ -702,7 +702,17 @@ class RunQueueData:
                 else:
                     msg += "\n This usually means one provides something the other doesn't and should."
                     logger.error(msg)
-
+                # Check whether multiple versions of the same PN are due to be
+                # built, for example:
+                # <pn>-1.0
+                # <pn>-2.0
+                seen_pn = []
+                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." % pn)
 
         # Create a whitelist usable by the stamp checks
         stampfnwhitelist = []
Signature · 1 line
1.7.10.4
#2 lore raw

Re: [PATCH 1/1] runqueue.py: check whether multiple versions of the same PN are due to be built

Quoted 23 lines · Robert Yang

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]

Quoted 5 lines

[YOCTO #5094]

I think that we can quite earlier to fix the problem.

I've merged this although I did move the code and change the error message wording a little so the output is less confusing to the user.

Cheers,

Richard