Re: [bitbake-devel] [PATCH] parse: warn on trailing whitespace after line continuation backslash

Jaipaul Cheernam <[email protected]>
Newsgroups org.openembedded.lists.bitbake-devel
Message-ID <[email protected]>
On 2026-08-04 12:27, Richard Purdie wrote:
> On Tue, 2026-08-04 at 11:08 +0200, Jaipaul Cheernam via lists.openembedded.org wrote:
>> rstrip() is called before checking for backslash, so trailing spaces or
>> tabs after "\" go unnoticed. For example:
>>
>>      file://foo.patch \<TAB>
>>      file://bar.patch \
>>
>> The first line has a trailing tab after the backslash that is invisible
>> but ends up in patch context, causing patches to fail to apply on trees
>> where it was cleaned up.
>>
>> Emit a warning when this is detected so developers can fix it early.
>>
>> Tested with bitbake-selftest:
>>    $ python3 -m unittest lib.bb.tests.parse.ParseTest.test_parse_trailing_whitespace_continuation -v
>>    $ python3 -m unittest lib.bb.tests.parse.ParseTest.test_parse_clean_continuation_no_warning -v
>>
>>    2 tests OK
>>
>> Signed-off-by: Jaipaul Cheernam <[email protected]>
>> ---
>> Problem:
>> Ran into this while submitting libssh2 CVE patches to both master and
>> wrynose. The libssh2_1.11.1.bb on master has a stray tab after the
>> backslash on the CVE-2025-15661-3.patch line. Patches adding new file://
>> lines below it applied fine on master but git-am refused them on wrynose
>> because that branch doesn't have the trailing tab — context mismatch.
> This seems like a lot of code and complexity for what is in reality quite a minor issue which
> whilst annoying, doesn't actually break anything?
>
> Cheers,
>
> Richard


  Hi Richard,

   Fair point — it doesn't break parsing itself and the code churn is 
larger than ideal for a warning.

   Would you prefer if I just submitted the oe-core fixes to clean up 
the affected recipes instead and dropped this bitbake change? That 
solves the immediate problem without adding complexity to the parser.

   Alternatively, I could reduce this to a bb.note() (debug-level) so 
it's only visible with -v, keeping it minimal.

   Happy to go either way.

Thanks
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.