[1/1] fix(multiarch): do not double append variant suffix

Message ID 20260925072055.1729383-1-felix.moessbauer@siemens.com
State Priority Review
Headers show
Series [1/1] fix(multiarch): do not double append variant suffix | expand

Commit Message

Felix Moessbauer Sept. 25, 2026, 7:20 a.m. UTC
We currently unconditionally append the variant suffix, even if the
variable already contains it. This breaks if a -native recipe variant
explicitly depends on another -native, as this results in a
-native-native variant.

We now change this by only adding the variant if the variable does not
end with any of the well known variants.

Fixes: 327fb313 ("sbuild: do not build arch all packages on cross")
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes-recipe/multiarch.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes-recipe/multiarch.bbclass b/meta/classes-recipe/multiarch.bbclass
index a30d530c..8b050500 100644
--- a/meta/classes-recipe/multiarch.bbclass
+++ b/meta/classes-recipe/multiarch.bbclass
@@ -88,9 +88,10 @@  python multiarch_virtclass_handler() {
                 if v.endswith('-compat') or v.endswith('-native'):
                     multiarch_var.append(v)
                 # dispatch -archall (arch=all) to native variant
-                if v.endswith('-archall'):
+                elif v.endswith('-archall'):
                     if suffix == '-native':
                         multiarch_var.append(v[:-len('-archall')])
+                # avoid appending the suffix if it is already present
                 else:
                     multiarch_var.append(v + suffix)
             d.setVar(var, ' '.join(multiarch_var))