<?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>16298</bug_id>
          
          <creation_ts>2026-05-23 14:28:52 +0000</creation_ts>
          <short_desc>Can&apos;t create fitImage with kernel-devicetree support</short_desc>
          <delta_ts>2026-07-09 08:13:23 +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>kernel</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gyorgy Sarvari">skandigraun</reporter>
          <assigned_to name="Gyorgy Sarvari">skandigraun</assigned_to>
          <cc>ccasciato</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>sivakumar.bs</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>105560</commentid>
    <comment_count>0</comment_count>
    <who name="Gyorgy Sarvari">skandigraun</who>
    <bug_when>2026-05-23 14:28:52 +0000</bug_when>
    <thetext>The current state:
- kernel-devicetree.bbclass contains a do_compile:append snippet, which is shell
- kernel-fit-image.bbclass defines its own do_compile - which is in python
- as one extra note, kernel.bbclass inherits kernel-devicetree.bbclass (though I guess this class can be avoided if one really wants to...)

When trying to create a fit image while also using the kernel-devicetree class, parsing errors out due to this mixed shell-python do_compile. Usually it ends in an error something like this:

```
ERROR: Unable to parse /home/meee/stuff/yocto/build/../meta-pine64/recipes-kernel/linux/linux-pine64_6.17.bb
Traceback (most recent call last):
  File &quot;/home/meee/stuff/yocto/bitbake/lib/bb/cooker.py&quot;, line 2334, in parse_next
    raise result
  File &quot;/home/meee/stuff/yocto/build/../oe-core/meta/classes-recipe/kernel-fit-image.bbclass&quot;, line 202
    }
     ^
IndentationError: unexpected indent
```

I think the kernel-devicetree and kernel-fit-image classes should be able to work together, but if I would be mistaken by this, handling this error in a special was would be nice, because it took some head scratching to find the actual problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105561</commentid>
    <comment_count>1</comment_count>
    <who name="Gyorgy Sarvari">skandigraun</who>
    <bug_when>2026-05-23 14:40:27 +0000</bug_when>
    <thetext>Apologies, I posted a wrong error output in my original description. That was a mid-debugging output. When using these classes, the actual error is a TabError:

```
ERROR: Unable to parse /home/meee/stuff/yocto/build/../meta-pine64/recipes-kernel/linux/linux-pine64_6.17.bb
Traceback (most recent call last):
  File &quot;/home/meee/stuff/yocto/bitbake/lib/bb/cooker.py&quot;, line 2334, in parse_next
    raise result
  File &quot;/home/meee/stuff/yocto/build/../oe-core/meta/classes-recipe/kernel-fit-image.bbclass&quot;, line 202
    }
    ^
TabError: inconsistent use of tabs and spaces in indentation
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105646</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-05-28 14:47:57 +0000</bug_when>
    <thetext>A work-around may be to change the appends to postfuncs
This would avoid the syntax errors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106071</commentid>
    <comment_count>3</comment_count>
    <who name="Siva Balasubramanian">sivakumar.bs</who>
    <bug_when>2026-07-02 10:37:40 +0000</bug_when>
    <thetext>Hi Gyorgy,

I looked into this and can reproduce the root cause from source:
kernel-devicetree.bbclass uses do_compile:append() (shell) which
conflicts with kernel-fit-image.bbclass&apos;s python do_compile(), causing
the TabError at parse time.

I have a fix ready following Randy&apos;s postfuncs suggestion - converting
the do_compile:append() to a named function registered via
do_compile[postfuncs], which is language-agnostic and avoids the
conflict entirely. Shell code is unchanged so behavior is identical for
recipes not using kernel-fit-image.

Are you still planning to work on this? If not, happy to send a patch.

Thanks,
Siva</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106127</commentid>
    <comment_count>4</comment_count>
    <who name="Gyorgy Sarvari">skandigraun</who>
    <bug_when>2026-07-09 08:13:23 +0000</bug_when>
    <thetext>I have no intention to send any patches to the project in the near future. Please feel free to use this bugreport as you see it fit.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>