Bug 15731 - cml1.bbclass: Invalid shell syntax in line 61: "\\$?"
Summary: cml1.bbclass: Invalid shell syntax in line 61: "\\$?"
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: oe-core other (show other bugs)
Version: 5.0.6
Hardware: x86 x86_64
: Medium+ normal
Target Milestone: Future
Assignee: Sven Kalmbach
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2025-01-29 08:14 UTC by Sven Kalmbach
Modified: 2025-04-01 20:34 UTC (History)
3 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 Sven Kalmbach 2025-01-29 08:14:30 UTC
Lines 61-62 of cml1.bbclass contains:
> oe_terminal("sh -c 'make %s; if [ \\$? -ne 0 ]; then ...
Escaping $? is wrong in this context, as it's already escaped by the quotes.
This causes the error handling logic not to run if make fails. The double backslash can be removed.
Comment 1 Randy MacLeod 2025-01-30 15:42:15 UTC
Sven can you send a patch to the list?

If so, see: https://docs.yoctoproject.org/contributor-guide/index.html
Comment 2 Sven Kalmbach 2025-02-05 07:34:07 UTC
(In reply to Randy MacLeod from comment #1)
> Sven can you send a patch to the list?
> 
> If so, see: https://docs.yoctoproject.org/contributor-guide/index.html

I'll check out the guide, if I find the time :)
Comment 3 Randy MacLeod 2025-02-06 15:50:05 UTC
Hoping the Sven can find the time.
Comment 4 Sven Kalmbach 2025-02-12 14:55:36 UTC
(In reply to Randy MacLeod from comment #3)
> Hoping the Sven can find the time.

I found the time (https://lists.openembedded.org/g/openembedded-core/topic/patch_fixes_yocto_15731/111143606). I hope the patch is formatted well enough, since I can not use git send-email.
Comment 5 Sven Kalmbach 2025-04-01 06:40:57 UTC
I've implemented the fix since last time and sent a (well-formated) patch to the mailing list (https://lists.openembedded.org/g/openembedded-core/message/211948)
Comment 6 Randy MacLeod 2025-04-01 20:34:05 UTC
Thanks Sven, it's merged to master and walnascar:

https://git.openembedded.org/openembedded-core/commit/?id=5c44a9154f0cd4252d4840d836e6936393b5d3a3

❯ git branch -a --contains 5c44a9154f0cd4252d4840d836e6936393b5d3a3
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/master-next
  remotes/origin/walnascar