<?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>8777</bug_id>
          
          <creation_ts>2015-12-07 10:59:56 +0000</creation_ts>
          <short_desc>The layer priorities are not obeyed properly</short_desc>
          <delta_ts>2015-12-08 13:32:59 +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>Toaster</product>
          <component>toaster</component>
          <version>2.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>ppc</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sujith H">sujith.h</reporter>
          <assigned_to name="Toaster default assignee">toaster</assigned_to>
          <cc>belen.barros.pena</cc>
    
    <cc>bluelightning</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Mihail Stanciu">stanciux.mihail</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>57070</commentid>
    <comment_count>0</comment_count>
    <who name="Sujith H">sujith.h</who>
    <bug_when>2015-12-07 10:59:56 +0000</bug_when>
    <thetext>While triggering an image at Mentor, it was observed that recipe talloc was breaking at do_configure phase. After a bit of investigation it was figured out that 2 bbclass-es are not taken:
a) qemu.bbclass
b) waf-samba.bbclass

These bbclasses fall under meta-mentor-staging layer ((Reference: http://git.yoctoproject.org/cgit/cgit.cgi/meta-mentor/tree/meta-mentor-staging/classes?h=cedar).

Instead the build was taking waf-samba.bbclass from meta-oe layer and qemu.bbclass from poky/meta layer.

When ran the below in a django shell ( thanks to Michael Wood for the helping hand which helped me understand the problem ):

-------------
(venv)sujith@kdekidd0:~/myproject$ ~/mgc/embedded/mel/2015.12.119/poky/bitbake/lib/toaster/manage.py shell
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
(InteractiveConsole)
&gt;&gt;&gt; from orm.models import *
&gt;&gt;&gt; from bldcontrol.models import BuildRequest
&gt;&gt;&gt; Layer_Version.objects.filter(layer__name=&quot;meta-mentor-staging&quot;).last().priority
0
&gt;&gt;&gt;  Layer_Version.objects.filter(layer__name=&quot;meta-python&quot;).last().priority
0
&gt;&gt;&gt;  Layer_Version.objects.filter(layer__name=&quot;meta-mentor-staging&quot;).first().priority
10
&gt;&gt;&gt; Layer_Version.objects.filter(layer__name=&quot;meta-oe&quot;).last().priority
0
&gt;&gt;&gt; Layer_Version.objects.filter(layer__name=&quot;meta-oe&quot;).first().priority
6
&gt;&gt;&gt; 

-------------

I am not sure why the priority is reset to 0 ( zero ). I assume this could be reproducible, if we create multiple layers let&apos;s say: meta-a, meta-b, meta-c etc and then copy a bbclass to one of the newly created layers. Update the do_configure as follows
do_configure ()  {
   echo &quot; I am here... &quot; &gt; /tmp/test.log
  #Rest of the code should be kept as it is
  ... 
}

So when user tries to run the recipe&apos;s configure from toaster, he/she should be able to see /tmp/test.log file. Else we are hit with a crucial bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57104</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-12-07 19:36:13 +0000</bug_when>
    <thetext>So there may well be a bug relating to layer priorities; but do note that when a bbclass is found in multiple layers, layer priority *does not* control which one is picked up - that&apos;s controlled solely through BBPATH. Since it&apos;s each layers&apos; layer.conf that sets BBPATH, it can be influenced by the order in which the layer appears in bblayers.conf; additionally the layer.conf may choose to append or prepend to BBPATH which will also affect the overall order of paths in the final BBPATH value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57116</commentid>
    <comment_count>2</comment_count>
    <who name="Sujith H">sujith.h</who>
    <bug_when>2015-12-08 02:54:54 +0000</bug_when>
    <thetext>Paul Eggleton, thanks a ton for pointing out about BBPATH. What I have observed is that command line builds are successfully creating images. I will update/share BBPATH values accordingly here ( once I reach office )</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57126</commentid>
    <comment_count>3</comment_count>
    <who name="Sujith H">sujith.h</who>
    <bug_when>2015-12-08 13:30:24 +0000</bug_when>
    <thetext>I have verified today by looking into the bblayers.conf file. So lets say if there are layers in the order ( after sourcing of meta-mentor/setup-environment script) a , b , c. The toasterconf.json file is having layer information in the reverse order: c, b , a. And as a result when toaster is executed from the terminal, the layer order remains as: c, b , a. And hence as Paul Eggleton suggested, the issue lies in the BBPATH. 

So I tried to rectify it in my custom script which creates toasterconf.json file. And which resolved the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57127</commentid>
    <comment_count>4</comment_count>
    <who name="Sujith H">sujith.h</who>
    <bug_when>2015-12-08 13:32:59 +0000</bug_when>
    <thetext>Marking this issue as Resolved-&gt;Notabug.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>