<?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>16432</bug_id>
          
          <creation_ts>2026-09-21 08:16:35 +0000</creation_ts>
          <short_desc>In wic class, the &quot;.wks.in&quot; template feature is not documented</short_desc>
          <delta_ts>2026-11-02 09:52:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>9</classification_id>
          <classification>Documentation</classification>
          <product>Reference</product>
          <component>handbook</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>IN PROGRESS DOCUMENTATION</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>6.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yoann Congal">yoann.congal</reporter>
          <assigned_to name="Antonin Godard">antonin.godard</assigned_to>
          <cc>ccasciato</cc>
    
    <cc>poky.doc.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>twoerner</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>106895</commentid>
    <comment_count>0</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2026-09-21 08:16:35 +0000</bug_when>
    <thetext>I find this feature useful (and is used in projects), even in oe-core:
- meta/files/wic/efi-bootdisk.wks.in
- meta/files/wic/efi-uki-bootdisk.wks.in
- meta-selftest/files/wic/overlayfs_etc.wks.in
- meta-selftest/files/wic/test_rawcopy_plugin.wks.in</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107012</commentid>
    <comment_count>1</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2026-10-05 23:34:55 +0000</bug_when>
    <thetext>The two differ by more than the extension: they are expanded by different
programs against different variable sets. Same four references, run down
both paths:

  reference           WICVARS  .wks (wic)          .wks.in (bitbake)
  ${IMAGE_ROOTFS}     yes      /path/to/rootfs     /path/to/rootfs
  ${TMPDIR}           no       ${TMPDIR}           /build/tmp
  ${@1024*2}          n/a      ${@1024*2}          2048
  ${NOWHERE_DEFINED}  no       ${NOWHERE_DEFINED}  (empty)

TMPDIR is set in the datastore but is not one of the 33 WICVARS names,
which is the whole of why row two differs; NOWHERE_DEFINED is set in
neither.

A .wks is expanded by wic&apos;s expand_line() from &lt;image&gt;.env, which
do_rootfs_wicenv writes from WICVARS alone. An undefined name warns and
survives verbatim; ${@...} never matches wic&apos;s regex, so it passes through
without even a warning.

A .wks.in is expanded by bitbake: image_types_wic.bbclass reads the body
into _WKS_TEMPLATE and do_write_wks_template writes out
d.getVar(&apos;_WKS_TEMPLATE&apos;). Anything still looking like a reference is
afterwards deleted, so an undefined name silently becomes empty - the
opposite of the .wks behaviour.

Worth stating explicitly: a .wks.in using &quot;include&quot; gets both regimes.
do_write_wks_template expands only the template body; the included file is
opened later by wic&apos;s _parse(), so it sees WICVARS alone. Verified by
parsing an outer .wks whose include named one variable of each kind: the
first expanded, the second stayed literal.

ref-manual/classes.rst (uboot-extlinux-config) already tells the reader to
&quot;explicitly configure the .wks.in file&quot; without the manuals saying what
one is: the term is in use ahead of its definition.

Against openembedded-core 3e06b44aa911 and wic 610a61a25e5f.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107267</commentid>
    <comment_count>2</comment_count>
    <who name="Antonin Godard">antonin.godard</who>
    <bug_when>2026-11-02 09:52:00 +0000</bug_when>
    <thetext>(In reply to Trevor Woerner from comment #1)
&gt; Worth stating explicitly: a .wks.in using &quot;include&quot; gets both regimes.
&gt; do_write_wks_template expands only the template body; the included file is
&gt; opened later by wic&apos;s _parse(), so it sees WICVARS alone. Verified by
&gt; parsing an outer .wks whose include named one variable of each kind: the
&gt; first expanded, the second stayed literal.

I&apos;ve also found that the include directive is only supported for .wks files, not .wks.in. Documented it, and the rest of this bug in https://lore.kernel.org/r/20261102-wks-in-v1-0-fbb797a3d5cb@bootlin.com.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>