<?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>2043</bug_id>
          
          <creation_ts>2012-03-01 02:07:44 +0000</creation_ts>
          <short_desc>modifying patch.bbclass functions breaks quilt-native</short_desc>
          <delta_ts>2012-03-02 16:30:01 +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>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>1.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>Two patches submitted to resolve the problems discussed here</status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Bruce Ashfield">bruce.ashfield</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.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>18818</commentid>
    <comment_count>0</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2012-03-01 02:07:44 +0000</bug_when>
    <thetext>If patch.bbclass is modified, it results in the following error:

NOTE: package quilt-native-0.51-r0: task do_patch: Started
ERROR: Error executing a python function in /home/bruce/poky/meta/recipes-devtools/quilt/quilt-native_0.51.bb:
IndexError: list index out of range

ERROR: The stack trace of python calls that resulted in this exception/failure was:
ERROR:   File &quot;patch_do_patch&quot;, line 57, in &lt;module&gt;
ERROR: 
ERROR:   File &quot;patch_do_patch&quot;, line 52, in patch_do_patch
ERROR: 
ERROR:   File &quot;/home/bruce/poky/meta/lib/oe/patch.py&quot;, line 358, in Resolve
ERROR:     patchcmd = self.patchset.Push(True, False, False)
ERROR: 
ERROR:   File &quot;/home/bruce/poky/meta/lib/oe/patch.py&quot;, line 148, in Push
ERROR:     bb.note(&quot;applying patch %s&quot; % self.patches[self._current])
ERROR: 
ERROR: The code that was being executed was:
ERROR:      0053:               except bb.BBHandledException as e:
ERROR:      0054:                       bb.fatal(str(e))
ERROR:      0055:
ERROR:      0056:
ERROR:  *** 0057:patch_do_patch(d)
ERROR:      0058:
ERROR: (file: &apos;patch_do_patch&apos;, lineno: 57, function: &lt;module&gt;)
ERROR:      0048:                       patchset.Import({&quot;file&quot;:local, &quot;strippath&quot;: parm[&apos;striplevel&apos;]}, True)
ERROR:      0049:               except Exception as exc:
ERROR:      0050:                       bb.fatal(str(exc))
ERROR:      0051:               try:
ERROR:  *** 0052:                       resolver.Resolve()
ERROR:      0053:               except bb.BBHandledException as e:
ERROR:      0054:                       bb.fatal(str(e))
ERROR:      0055:
ERROR:      0056:
ERROR: (file: &apos;patch_do_patch&apos;, lineno: 52, function: patch_do_patch)
ERROR: Function failed: patch_do_patch

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

Richard&apos;s email analysis is below:


Hi Bruce,

I had a look at your do_patch problems. First, some observations:

a) Most recipes are patched using quilt
b) If patches are already applied, quilt will remove and reapply them
c) You can&apos;t use quilt to patch quilt-native. It uses patch instead
d) patch does not remove existing patches
e) We recently added hashes of the tasks to the stamp files. This means
  if a hash changes for a task, the task gets rerun.

If you change any code or variable in patch.bbclass that do_patch
depends upon, it is very likely to alter the do_patch task hashes. This
means in particular the do_patch hash of quilt-native is invalidated and
it will rerun.

Due to d) above, it will fail. It will not fail for any other recipes
due to a)+b).

So its expected that it would rerun do_patch and we need to fix
quilt-native so that task is re-entrant safe and checks if the patch is
already applied. Please file a bug.

Cheers,

Richard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18833</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-03-01 23:25:41 +0000</bug_when>
    <thetext>Note to get this backtrace PATCHRESOLVE = &quot;user&quot; is also required. A failure of the do_patch task itself is found if you have PATCHRESOLVE = &quot;noop&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18849</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-03-02 16:30:01 +0000</bug_when>
    <thetext>Patches http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=93b3692ac810f7129f6561b446847800aecaf352 and the previous commit added to address the issues reported here.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>