Re: [bitbake-devel] [PATCH] parse: warn on trailing whitespace after line continuation backslash
Richard Purdie <[email protected]>
| Newsgroups | org.openembedded.lists.bitbake-devel |
|---|---|
| Message-ID | <056c55ee98f7d48caa6bf45152cd63115b9d3132.camel@linuxfoundation.org> |
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