<?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>11649</bug_id>
          
          <creation_ts>2017-06-12 23:17:47 +0000</creation_ts>
          <short_desc>kernel-yocto.bbclass doesn&apos;t catch missing config.queue</short_desc>
          <delta_ts>2017-08-16 00:54:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Kernel</product>
          <component>kernel-configuration</component>
          <version>2.2</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>Backport to 2.3.1 &amp; 2.2.2</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>klapperichpaul</reporter>
          <assigned_to name="Bruce Ashfield">bruce.ashfield</assigned_to>
          <cc>yp.kernel.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          
          <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>74033</commentid>
    <comment_count>0</comment_count>
    <who name="">klapperichpaul</who>
    <bug_when>2017-06-12 23:17:47 +0000</bug_when>
    <thetext>kernel-yocto.bbclass contains the following lines:

meta_dir=$(kgit --meta)
configs=&quot;$(scc --configs -o ${meta_dir})&quot;
if [ -z &quot;${configs}&quot; ]; then
        bbfatal_log &quot;Could not find configuration queue (${meta_dir}/config.queue)&quot;
fi

My $(meta_dir) didn&apos;t contain a config.queue and I should have been show the error in the if statement above. Unfortunately, scc produces the helpful output:

[ERROR]: no configuration queue found in outdir (.kernel-meta)

Since this gets stored in the configs variable, the -z test fails and the error is not shown. Instead a different error is thrown later on when the bad ${configs} is used.

scc does return an exit status of 1 in this case. Thus I think kernel-yocto.bbclass should be changed to 

meta_dir=$(kgit --meta)
configs=&quot;$(scc --configs -o ${meta_dir})&quot;
if [ $? -ne 0 ]; then
        bbfatal_log &quot;Could not find configuration queue (${meta_dir}/config.queue)&quot;
fi


Alternatively, maybe it would be good to test for the existence of &apos;${meta_dir}/config.queue&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74038</commentid>
    <comment_count>1</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2017-06-13 07:20:55 +0000</bug_when>
    <thetext>That is indeed the right fix, catching the error twice .. but not reporting it properly once. 

I&apos;ll tweak the fix slightly to check the error code and then propagate the scc error message directly, but otherwise, it is the same.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75876</commentid>
    <comment_count>2</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2017-08-16 00:54:45 +0000</bug_when>
    <thetext>commit aa7fc34dc4c07c3e22539249999282dd6b3cf1e6
Author: Bruce Ashfield &lt;bruce.ashfield@windriver.com&gt;
Date:   Tue Jun 13 03:26:17 2017 -0400

    kernel-yocto: propagate configuration errors to bbclass
    
    As pointed out by klapperichpaul@johndeere.com, missing configuration
    fragments were being picked up twice, once by the tools and once by the
    bbclass. Unfortunately, the tools error message was being detected as
    configs, and hence no error was reported at all.
    
    Rather than catching the output of the tools, we can instead check the
    return code and propagate the error message from the tools directly to
    the user.
    
    [YOCTO #11649]
    
    (From OE-Core rev: 960652416e2390337df6d9734375d6829ceb6420)
    
    Signed-off-by: Bruce Ashfield &lt;bruce.ashfield@windriver.com&gt;
    Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>