Bug 15470

Summary: Leading space before } silently breaks parse
Product: [Build System, Metadata & Runtime] BitBake Reporter: Ross Burton <ross.burton>
Component: bitbakeAssignee: Sawas Etairidis <Falital>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: Falital, poky.bs.watcher, poky.watcher, randy.macleod, richard.purdie
Version: 5.1   
Target Milestone: 5.99   
Hardware: x86   
OS: Multiple   
Whiteboard: NEWCOMER
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

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.