<?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>12132</bug_id>
          
          <creation_ts>2017-09-27 16:27:05 +0000</creation_ts>
          <short_desc>Running diffconfig task from BitBake returns error</short_desc>
          <delta_ts>2017-10-06 10:43:24 +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-tooling</component>
          <version>2.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>normal</bug_severity>
          <target_milestone>2.4 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Scott Rifenbark">srifenbark</reporter>
          <assigned_to name="Bruce Ashfield">bruce.ashfield</assigned_to>
          <cc>leonardo.sandoval.gonzalez</cc>
    
    <cc>pokylinux</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>yp.kernel.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>Regression (Used to work)</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>77164</commentid>
    <comment_count>0</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-09-27 16:27:05 +0000</bug_when>
    <thetext>In attempting to perform steps in the kernel manual to create a configuration fragment using diffconfig, the task returns an error indicating that no configuration files exist when they do. 

Here are the steps to reproduce:

1. Have an existing build in ~/poky/build
2. cd ~/poky/build
3. bitbake linux-yocto -c kernel_configme -f
4. bitbake linux-yocto -c menuconfig

Step 4 invokes menuconfig.  Once menuconfig is running, make a minor change to the configuration and save the change and exit menuconfig

5. bitbake linux-yocto -c diffconfig

Step 5 returns errors.  See https://pastebin.com/7bpdLSJ0 for the console output.

=========================

output here if that is easier....


Loading cache: 100% |##################################################################| Time: 0:00:00
Loaded 1275 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.35.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;universal&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.4&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;rocko:592c3449697ce39bf07864fafd7f0a61ca230561&quot;
meta-mylayer      = &quot;&lt;unknown&gt;:&lt;unknown&gt;&quot;

WARNING: /home/scottrif/poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb.do_kernel_configme is tainted from a forced run
Initialising tasks: 100% |#############################################################| Time: 0:00:00
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: linux-yocto-4.12.12+gitAUTOINC+eda4d18ce4_16de014967-r0 do_diffconfig: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: &apos;exec_python_func() autogenerated&apos;, lineno: 2, function: &lt;module&gt;
     0001:
 *** 0002:do_diffconfig(d)
     0003:
File: &apos;/home/scottrif/poky/meta/classes/cml1.bbclass&apos;, lineno: 66, function: do_diffconfig
     0062:        bb.fatal(&quot;No config files found. Did you do menuconfig ?\n%s&quot; % e)
     0063:
     0064:    if isdiff:
     0065:        statement = &apos;diff --unchanged-line-format= --old-line-format= --new-line-format=&quot;%L&quot; &apos; + configorig + &apos; &apos; + config + &apos;&gt;&apos; + fragment
 *** 0066:        subprocess.check_call(statement, shell=True)
     0067:
     0068:        shutil.copy(configorig, config)
     0069:
     0070:        bb.plain(&quot;Config fragment has been dumped into:\n %s&quot; % fragment)
File: &apos;/usr/lib/python3.5/subprocess.py&apos;, lineno: 581, function: check_call
     0577:    if retcode:
     0578:        cmd = kwargs.get(&quot;args&quot;)
     0579:        if cmd is None:
     0580:            cmd = popenargs[0]
 *** 0581:        raise CalledProcessError(retcode, cmd)
     0582:    return 0
     0583:
     0584:
     0585:def check_output(*popenargs, timeout=None, **kwargs):
Exception: subprocess.CalledProcessError: Command &apos;diff --unchanged-line-format= --old-line-format= --new-line-format=&quot;%L&quot; .config.orig .config&gt;/home/scottrif/poky/build/tmp/work/qemux86-poky-linux/linux-yocto/4.12.12+gitAUTOINC+eda4d18ce4_16de014967-r0/fragment.cfg&apos; returned non-zero exit status 1

ERROR: linux-yocto-4.12.12+gitAUTOINC+eda4d18ce4_16de014967-r0 do_diffconfig: Function failed: do_diffconfig
ERROR: Logfile of failure stored in: /home/scottrif/poky/build/tmp/work/qemux86-poky-linux/linux-yocto/4.12.12+gitAUTOINC+eda4d18ce4_16de014967-r0/temp/log.do_diffconfig.26418
ERROR: Task (/home/scottrif/poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb:do_diffconfig) failed with exit code &apos;1&apos;
NOTE: Tasks Summary: Attempted 24 tasks of which 23 didn&apos;t need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/scottrif/poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb:do_diffconfig
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77200</commentid>
    <comment_count>1</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2017-09-28 15:24:23 +0000</bug_when>
    <thetext>This commit broke the routine. diff returns &apos;1&apos; if there are differences and
it isn&apos;t an error. So the switch to check_call is not right for this routine.

I&apos;ll send patch to restore the old call.

commit b090ff6a277aa6e242020d7d6ffb1d351e3ee4e0
Author: Mikko Rapeli &lt;mikko.rapeli@bmw.de&gt;
Date:   Thu Jun 22 16:23:14 2017 +0300

    meta: Fix return value checks from subprocess.call()&apos;s
    
    Python function subprocess.call() returns the return value of the
    executed process. If return values are not checked, errors may
    go unnoticed and bad things can happen.
    
    Change all callers of subprocess.call() which do not check for
    the return value to use subprocess.check_call() which raises
    CalledProcessError if the subprocess returns with non-zero value.
    
    https://docs.python.org/2/library/subprocess.html#using-the-subprocess-module
    
    All users of the function were found with:
    
    $ git grep &quot;subprocess\.call&quot; | \
      egrep -v &apos;if.*subprocess\.call|=\ +subprocess\.call|return.*subprocess\.call&apos;
    
    Tested similar patch on top of yocto jethro. Only compile tested
    core-image-minimal on poky master branch.
    
    (From OE-Core rev: 578c8205fd14c48c6d30ef2889d86f1b4aee060a)
    
    Signed-off-by: Mikko Rapeli &lt;mikko.rapeli@bmw.de&gt;
    Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;

:100644 100644 38e6613c486d... eb8e7907f602... M        meta/classes/cml1.bbclass</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77416</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-10-06 10:43:24 +0000</bug_when>
    <thetext>*** Bug 12161 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>