<?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>13205</bug_id>
          
          <creation_ts>2019-02-26 19:09:30 +0000</creation_ts>
          <short_desc>Bitbake should warn about whitespace misuse in variable assignments</short_desc>
          <delta_ts>2026-08-13 15:26:38 +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>BitBake</product>
          <component>bitbake</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>enhancement</bug_severity>
          <target_milestone>6.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Evadeflow">evadeflow</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>alexandre.belloni</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</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>83125</commentid>
    <comment_count>0</comment_count>
    <who name="Evadeflow">evadeflow</who>
    <bug_when>2019-02-26 19:09:30 +0000</bug_when>
    <thetext>It&apos;s a bit unfortunate that Bitbake silently accepts lines like this:

&gt; SRC_URI_append = &quot;file://capture.sh&quot;

when the user almost certainly should have typed:

&gt; SRC_URI_append = &quot; file://capture.sh&quot;

In a similar vein, likes like this:

&gt; RM_WORK_EXCLUDE += &quot; rawv4l2cap&quot;

are accepted, even though—in the vast majority of cases—they should read:

&gt; RM_WORK_EXCLUDE += &quot;rawv4l2cap&quot;


Personally, I must have copy/pasted += assignments with [useless] extra whitespace at least a hundred times in the last five years. This anti-pattern is *everywhere* out there in the wild, and it makes the output from running `bitbake -e` inscrutable.

Bitbake should warn users when they misuse whitespace, perhaps with an override to silence the warning for those rare cases where the usage is legitimate/necessary. Although... I&apos;ve not personally encountered a case where, say `FOO_append = &quot;.sh&quot;` couldn&apos;t be replaced with `FOO .= &quot;.sh&quot;`, so... perhaps it ought to be a warning for a few Bitbake versions, which eventually becomes a &apos;hard&apos; error after the deprecation period is over.

Anyway, leveraging the tool itself to lint out this rampant anti-pattern may be the only practical way to grapple with it. If Bitbake continues permitting users to include extra whitespace—or omit it when it should be required—they&apos;ll just keep doing it, and posting recipes with &apos;bad&apos; snippets that get copy/pasted around to other recipes, perpetuating the cycle.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94999</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-02-23 15:57:50 +0000</bug_when>
    <thetext>Still a useful idea.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95605</commentid>
    <comment_count>2</comment_count>
    <who name="Alexandre Belloni">alexandre.belloni</who>
    <bug_when>2023-05-30 16:12:11 +0000</bug_when>
    <thetext>There are variables that are colon separated lists, like FILESEXTRAPATHS where one would use:

FILESEXTRAPATHS:prepend := &quot;${THISDIR}/util-linux:&quot;

as in meta/recipes-core/util-linux/util-linux.inc

So the first example is not something we can warn about without annotating whether the variable is a space separated list or not which will add overhead to bitbake parsing code.

Also, if someone omits the space, the result is likely to not work as expected which will get fixed.


The second case is cosmetic and is easier to warn about. However, we have variables that will include other variables that may be empty, so we will never be able to catch all the duplicated spaces. E.g:

CORE_IMAGE_BASE_INSTALL = &apos;\
    packagegroup-core-boot \
    packagegroup-base-extended \
    \
    ${CORE_IMAGE_EXTRA_INSTALL} \
    &apos;

CORE_IMAGE_EXTRA_INSTALL ?= &quot;&quot;

IMAGE_INSTALL ?= &quot;${CORE_IMAGE_BASE_INSTALL}&quot;

As soon as you append something to IMAGE_INSTALL (with a space then) and CORE_IMAGE_EXTRA_INSTALL stays empty, you will have two consecutive spaces.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96871</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-10-24 14:24:34 +0000</bug_when>
    <thetext>Bulk move from 4.99 or 0.00 to 5.99</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>