<?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>3874</bug_id>
          
          <creation_ts>2013-02-11 16:35:03 +0000</creation_ts>
          <short_desc>Overrides are evaluated for primary and multilib configuration, causing potential conflicts</short_desc>
          <delta_ts>2013-02-14 10:15:17 +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>OE-Core</product>
          <component>core</component>
          <version>1.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>1.4 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Hatle">mark.hatle</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>29714</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2013-02-11 16:35:03 +0000</bug_when>
    <thetext>Reproducer:

cd meta/recipes-devtools/valgrind
touch valgrind-3.8.1/powerpc.patch
touch valgrind-3.8.1/powerpc64.patch

edit valgrind_3.8.1.bb

+SRC_URI_append_powerpc = &quot; file://powerpc.patch&quot;
+SRC_URI_append_powerpc64 = &quot; file://powerpc64.patch&quot;


cd meta/conf/machine
cp qemuppc.conf qemuppc64.conf

edit qemuppc64.conf:

-require conf/machine/include/tune-ppc603e.inc
+require conf/machine/include/tune-ppce5500.inc

(Note, this will not result in functional machine, but it&apos;s enough to reproduce the problem!)

modify your conf/local.conf

MACHINE = &quot;qemuppc64.conf&quot;

require conf/multilib.conf
MULTILIBS = &quot;multilib:lib64&quot;
DEFAULTTUNE_virtclass-multilib-lib64 = &quot;ppc64e5500&quot;


To see the problem:
bitbake -e valgrind | grep &quot;^SRC_URI=&quot;


SRC_URI=&quot;http://www.valgrind.org/downloads/valgrind-3.8.1.tar.bz2          file://fix_issue_caused_by_ccache.patch            file://fix_unsupporting_kernel_3.patch            file://fixed-perl-path.patch            file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch            file://configure-with-newer-glibc.patch            file://powerpc.patch&quot;

(that is correct)


bitbake -e lib64-valgrind | grep &quot;^SRC_URI=&quot;

SRC_URI=&quot;http://www.valgrind.org/downloads/valgrind-3.8.1.tar.bz2          file://fix_issue_caused_by_ccache.patch            file://fix_unsupporting_kernel_3.patch            file://fixed-perl-path.patch            file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch            file://configure-with-newer-glibc.patch            file://powerpc.patch file://powerpc64.patch&quot;

(that is incorrect, both powerpc and powerpc64 are listed!)

The &apos;OVERRIDES=&apos; values for both are correct...  What appears to be happening is SRC_URI is evaluated twice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29719</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2013-02-11 19:59:33 +0000</bug_when>
    <thetext>After some investigation.  It appears that the problem is related to the order in which bitbake processes various anonymous python chunks, specifically in:

bitbake/lib/bb/parse/ast.py:

def finalize(fn, d, variant = None):
    all_handlers = {}
    for var in d.getVar(&apos;__BBHANDLERS&apos;) or []:
...
    bb.event.fire(bb.event.RecipePreFinalise(fn), d)

    bb.data.expandKeys(d)
    bb.data.update_data(d)
    code = []
    for funcname in d.getVar(&quot;__BBANONFUNCS&quot;) or []:
        code.append(&quot;%s(d)&quot; % funcname)
    bb.utils.better_exec(&quot;\n&quot;.join(code), {&quot;d&quot;: d})
    bb.data.update_data(d)
...

The first update_data sets the values (and appends) using the default tune, while the second sets the values based on the updated OVERRIDES settings from the anonfuncs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29723</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2013-02-11 20:03:41 +0000</bug_when>
    <thetext>Possible workaround (fix?) from Richard Purdie:


diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index 5454b4c..d52f721 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -51,6 +51,11 @@ python multilib_virtclass_handler () {
     e.data.setVar(&quot;PN&quot;, variant + &quot;-&quot; + e.data.getVar(&quot;PN&quot;, False))
     e.data.setVar(&quot;SHLIBSDIR_virtclass-multilib-&quot; + variant ,e.data.getVar(&quot;SHL
     e.data.setVar(&quot;OVERRIDES&quot;, e.data.getVar(&quot;OVERRIDES&quot;, False) + override)
+
+    # Workaround for issue in YP Bugzilla #3874
+    newtune = e.data.getVar(&quot;DEFAULTTUNE_&quot; + &quot;virtclass-multilib-&quot; + variant)
+    if newtune:
+        e.data.setVar(&quot;DEFAULTTUNE&quot;, newtune)
 }
 
 addhandler multilib_virtclass_handler</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29732</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-02-11 22:43:12 +0000</bug_when>
    <thetext>The issue is that OVERRIDES has virtclass-multilib-xxxx added to it, this eventually changed DEFAULTTUNE which then changes TRANSLATED_TARGET_ARCH which is in OVERRIDES meaning we then need to reevaulate the overides and the TTA gets applied twice since once you apply an override, it doesn&apos;t get undone.

Expanding DEFAULTTUNE to the correct value in advance avoids the issue and means only the correct overrides get applied.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29789</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-02-14 10:15:17 +0000</bug_when>
    <thetext>Fixed in master, http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=e3f5d7dee070464c636c4cb38844e098ec9d75f8</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>