<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>5094</bug_id>
          
          <creation_ts>2013-09-02 07:36:35 +0000</creation_ts>
          <short_desc>Check whether multiple versions of the same PN are due to be built</short_desc>
          <delta_ts>2013-10-02 10:59:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>1.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.5 M5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Yang">liezhi.yang</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>razvanx.ionescu</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>36139</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-09-02 07:36:35 +0000</bug_when>
    <thetext>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 such an error:

ERROR: Package already staged (/buildarea/lyang1/build3/tmp/sstate-control/manifest-qemux86-make.populate-sysroot)?!
ERROR: Function failed: sstate_task_postfunc
ERROR: Logfile of failure stored in: /buildarea/lyang1/build3/tmp/work/i586-poky-linux/make/3.82-r3/temp/log.do_populate_sysroot.6565

Or there would be python&apos;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]

I think that we can quite earlier, the following patch would fix the problem:

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 197308f..6a80619 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -702,7 +702,17 @@ class RunQueueData:
                 else:
                     msg += &quot;\n This usually means one provides something the other doesn&apos;t and should.&quot;
                     logger.error(msg)
-
+                # Check whether multiple versions of the same PN are due to be
+                # built, for example:
+                # &lt;pn&gt;-1.0
+                # &lt;pn&gt;-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(&quot;Multiple versions of %s are due to be built.&quot; % pn)
 
         # Create a whitelist usable by the stamp checks
         stampfnwhitelist = []</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36447</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-09-10 01:46:18 +0000</bug_when>
    <thetext>Merged into master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=87771db34c660c82333bb47a17b31f18bbffe776</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37464</commentid>
    <comment_count>2</comment_count>
    <who name="Razvan Ionescu">razvanx.ionescu</who>
    <bug_when>2013-10-02 10:59:13 +0000</bug_when>
    <thetext>Verified with poky: 87771db34c660c82333bb47a17b31f18bbffe776

bitbake make-3.81 make-3.82


returns the following error message as expected:

ERROR: Multiple versions of make are due to be built (/home/razvan/yocto_work/pokytests/meta/recipes-devtools/make/make_3.81.bb /home/razvan/yocto_work/pokytests/meta/recipes-devtools/make/make_3.82.bb). Only one version of a given PN should be built in any given build. You likely need to set PREFERRED_VERSION_make to select the correct version or don&apos;t depend on multiple versions.

Summary: There was 1 ERROR message shown, returning a non-zero exit code.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>