[PATCH 1/1] compat: handle user errors gracefully to avoid parser splat

1 view
Skip to first unread message

Felix Moessbauer

unread,
Feb 27, 2026, 5:10:25 AM (5 days ago) Feb 27
to isar-...@googlegroups.com, Felix Moessbauer
A common user error is to forget to define a machine (or use one that is
not defined). In this case, a huge parsing error is printed, giving no
indication what the actually user error is. Instead of crashing the
parser, we now report a meaningful user error.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
Dear maintainers,

I recommend to include this patch in the upcoming release.

Best regards,
Felix

meta/classes-recipe/compat.bbclass | 3 +++
1 file changed, 3 insertions(+)

diff --git a/meta/classes-recipe/compat.bbclass b/meta/classes-recipe/compat.bbclass
index 907c3ce2..7df55576 100644
--- a/meta/classes-recipe/compat.bbclass
+++ b/meta/classes-recipe/compat.bbclass
@@ -19,6 +19,9 @@ python() {
package_arch = d.getVar('PACKAGE_ARCH')
overrides = d.getVar('OVERRIDES').split(':')

+ if not distro_arch:
+ bb.fatal("DISTRO_ARCH is not set")
+
localdata = bb.data.createCopy(d)
new_overrides = [distro_arch] + [o for o in overrides if not o == package_arch]
localdata.setVar('OVERRIDES', ':'.join(new_overrides))
--
2.51.0

Zhihang Wei

unread,
Mar 2, 2026, 3:41:31 AM (2 days ago) Mar 2
to Felix Moessbauer, isar-...@googlegroups.com
Applied to next, thanks.

Zhihang
Reply all
Reply to author
Forward
0 new messages