From 27190e2e5f95e23acf0b46fd797b873b711b8618 Mon Sep 17 00:00:00 2001 From: Antonin Godard Date: Thu, 13 Feb 2025 12:55:30 +0100 Subject: [PATCH] classes/rust_bin-common: avoid failing when os does not match The rust_bin-common defines rust_target(), a function called at parsing time by bitbake. Calling bb.fatal() in a multiconfig context builds is problematic, because the alternate config might not build for Linux. For example when building a baremetal companion firmware. Yet, our multiconfig recipes are still evaluated during parsing, and in this case, it makes more sense skipping the recipe rather than producing an error. Use bb.parse.SkipRecipe() instead of bb.fatal(). Signed-off-by: Antonin Godard --- classes/rust_bin-common.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/rust_bin-common.bbclass b/classes/rust_bin-common.bbclass index d03fb20..241233a 100644 --- a/classes/rust_bin-common.bbclass +++ b/classes/rust_bin-common.bbclass @@ -42,7 +42,7 @@ def rust_target(d, spec_type): tune = [] if not os == 'linux': - bb.fatal("Unsupported OS: %s. Only Linux is supported." % os) + raise bb.parse.SkipRecipe("Unsupported OS: %s. Only Linux is supported." % os) if arch in ["i386", "i486", "i586", "i686", "i786", "x86"]: arch = "i686"