<?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>7662</bug_id>
          
          <creation_ts>2015-04-27 13:05:12 +0000</creation_ts>
          <short_desc>Installing binary in allarch recipe causes traceback</short_desc>
          <delta_ts>2015-09-04 06:46:44 +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.8</version>
          <rep_platform>All</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>minor</bug_severity>
          <target_milestone>1.9 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Costin">costin.c.constantin</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>daniel.alexandrux.istrate</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>sgw</cc>
          
          <qa_contact name="Costin">costin.c.constantin</qa_contact>
          <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>50516</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-04-27 13:05:12 +0000</bug_when>
    <thetext>If you install a prebuilt binary in a recipe that inherits allarch, you get a nasty traceback:

-------------- snip --------------
ERROR: Error executing a python function in /home/user/poky/meta/recipes-core/example/example.bb:

The stack trace of python calls that resulted in this exception/failure was:
File: &apos;do_package_qa&apos;, lineno: 105, function: &lt;module&gt;
     0101:        bb.fatal(&quot;QA run found fatal errors. Please consider fixing them.&quot;)
     0102:    bb.note(&quot;DONE with PACKAGE QA&quot;)
     0103:
     0104:
 *** 0105:do_package_qa(d)
     0106:
File: &apos;do_package_qa&apos;, lineno: 88, function: do_package_qa
     0084:            package_qa_handle_error(&quot;pkgname&quot;,
     0085:                    &quot;%s doesn&apos;t match the [a-z0-9.+-]+ regex\n&quot; % package, d)
     0086:
     0087:        path = &quot;%s/%s&quot; % (pkgdest, package)
 *** 0088:        if not package_qa_walk(path, warnchecks, errorchecks, skip, package, d):
     0089:            walk_sane  = False
     0090:        if not package_qa_check_rdepends(package, pkgdest, skip, taskdeps, packages, d):
     0091:            rdepends_sane = False
     0092:        if not package_qa_check_deps(package, pkgdest, skip, d):
File: &apos;insane.bbclass&apos;, lineno: 19, function: package_qa_walk
     0015:                elf = None
     0016:            for func in warnfuncs:
     0017:                func(path, package, d, elf, warnings)
     0018:            for func in errorfuncs:
 *** 0019:                func(path, package, d, elf, errors)
     0020:
     0021:    for w in warnings:
     0022:        package_qa_handle_error(w, warnings[w], d)
     0023:    for e in errors:
File: &apos;insane.bbclass&apos;, lineno: 25, function: package_qa_check_arch
     0021:        return
     0022:
     0023:    #if this will throw an exception, then fix the dict above
     0024:    (machine, osabi, abiversion, littleendian, bits) \
 *** 0025:        = package_qa_get_machine_dict()[target_os][target_arch]
     0026:
     0027:    # Check the architecture and endiannes of the binary
     0028:    if not ((machine == elf.machine()) or \
     0029:        (((&quot;virtual/kernel&quot; in provides) or bb.data.inherits_class(&quot;module&quot;, d) ) and (target_os == &quot;linux-gnux32&quot; or target_os == &quot;linux-gnun32&quot;))):
Exception: KeyError: &apos;allarch&apos;

ERROR: Function failed: do_package_qa
ERROR: Logfile of failure stored in: /home/user/poky/build/tmp/work/all-poky-linux/example/1.0-r0/temp/log.do_package_qa.17373
ERROR: Task 9 (/home/user/poky/meta/recipes-core/example/example.bb, do_package_qa) failed with exit code &apos;1&apos;
-------------- snip --------------

Obviously this should trigger an error, but it should be a proper error message telling the user what they&apos;ve done wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51462</commentid>
    <comment_count>1</comment_count>
      <attachid>2536</attachid>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-06-03 08:42:43 +0000</bug_when>
    <thetext>Created attachment 2536
Example recipe

Attached an example recipe. This is totally synthetic, but at least triggers the error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51467</commentid>
    <comment_count>2</comment_count>
    <who name="Cristian Iorga">cristian.iorga</who>
    <bug_when>2015-06-03 08:56:13 +0000</bug_when>
    <thetext>Investigation started.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51546</commentid>
    <comment_count>3</comment_count>
    <who name="Cristian Iorga">cristian.iorga</who>
    <bug_when>2015-06-08 10:57:37 +0000</bug_when>
    <thetext>Patch sent for review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51661</commentid>
    <comment_count>4</comment_count>
    <who name="Cristian Iorga">cristian.iorga</who>
    <bug_when>2015-06-12 08:30:21 +0000</bug_when>
    <thetext>Fixed with commit: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=63e62599a6af469c1705c9272cd280b54d5b7144</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53659</commentid>
    <comment_count>5</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-09-03 09:14:22 +0000</bug_when>
    <thetext>Hi,

Did a recipe with the content from comment #1 :
cosscat@ubnt:/media/yp_builds/poky/meta/recipes-core/mytest$ ls
mytest_1a.bb

and created a simple executable /bin/file
cosscat@ubnt:/bin$ ls file
file

after bitbaking the recipe, the process goes well and &quot;file&quot; gets copied in ${D}/${bindir} :
cosscat@ubnt:/media/yp_builds/poky/build/tmp/work/all-poky-linux/mytest/1a-r0/image/usr/bin$ cat test-file 
#/bin/bash

echo &quot;hello&quot;

When i build it though, no err. message is displayed and build goes smooth.
According to the description it should have displayed an error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53660</commentid>
    <comment_count>6</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-09-03 09:15:00 +0000</bug_when>
    <thetext>Forgot to add, tested on latest master</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53692</commentid>
    <comment_count>7</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-09-03 15:00:02 +0000</bug_when>
    <thetext>What kind of file is this &quot;file&quot; you are testing with? If it&apos;s not a binary (i.e. an executable that isn&apos;t a script) then you aren&apos;t replicating the case that should trigger the error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53694</commentid>
    <comment_count>8</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-09-03 15:00:55 +0000</bug_when>
    <thetext>Moving to NEEDINFO based on the previous comment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53722</commentid>
    <comment_count>9</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-09-04 06:46:06 +0000</bug_when>
    <thetext>The file i was using was a script. I created a small hello world alike binary and the issue is reproducing well. My fault in the first place. 

Based on the above will mark as verified.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53723</commentid>
    <comment_count>10</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-09-04 06:46:44 +0000</bug_when>
    <thetext>Marked as verified based on last comment</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>2536</attachid>
            <date>2015-06-03 08:42:43 +0000</date>
            <delta_ts>2015-06-03 08:42:43 +0000</delta_ts>
            <desc>Example recipe</desc>
            <filename>brokeallarch.bb</filename>
            <type>text/plain</type>
            <size>172</size>
            <attacher name="Paul Eggleton">bluelightning</attacher>
            
              <data encoding="base64">TElDRU5TRSA9ICJDTE9TRUQiCgppbmhlcml0IGFsbGFyY2gKClNSQ19VUkkgPSAiZmlsZTovLy9i
aW4vZmlsZSIKCmRvX2luc3RhbGwoKSB7CglpbnN0YWxsIC1kICR7RH0ke2JpbmRpcn0KCWluc3Rh
bGwgLW0gMDc1NSAke1dPUktESVJ9L2Jpbi9maWxlICR7RH0ke2JpbmRpcn0vdGVzdC1maWxlCn0K
Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>