Bug 15470 - Leading space before } silently breaks parse
Summary: Leading space before } silently breaks parse
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 5.1
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 5.99
Assignee: Sawas Etairidis
QA Contact:
URL:
Whiteboard: NEWCOMER
Depends on:
Blocks:
 
Reported: 2024-04-11 19:44 UTC by Ross Burton
Modified: 2025-01-31 19:12 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2024-04-11 19:44:29 UTC
Pick a random recipe (say, m4) and replace the do_compile() task with something obvious:

do_compile() {
    foo
}

Then bitbake-getvar it:

$ bitbake-getvar  --recipe m4 --value do_compile
    foo

That's expected.  Now add one character of whitespace before the closing braces:

do_compile() {
    foo
 }

$ bitbake-getvar  --recipe m4 --value do_compile
    # Export function set
    autotools_do_compile

The entire assignment is lost, and no parse errors were shown.
Comment 1 Richard Purdie 2024-04-12 17:03:55 UTC
Patch in review. Could really do with adding a test case though.
Comment 2 Randy MacLeod 2024-04-18 14:34:31 UTC
Problem is fixed but we'll leave a newcomer bug to add a test case.
Comment 3 Sawas Etairidis 2024-09-25 07:44:18 UTC
Hi I created the missing test for this task see https://lists.openembedded.org/g/bitbake-devel/topic/patch_tests_parse_add/108644148
Comment 4 Richard Purdie 2025-01-28 14:53:49 UTC
https://git.yoctoproject.org/poky/commit/?h=master-next&id=934828e9638c2ac727618dbe0801ca073668c3a7

The patch was a bit mangled on the mailing list (= turned into =3D and line wrapped) but I sorted it out so we could resolve this open issue, thanks for the patch.
Comment 5 Sawas Etairidis 2025-01-31 19:12:03 UTC
Sorry for the mangling. Nice it got merged I will try to find another newcomer bug I can help now.