From f5c5d1dd6cb102e0026c3e7cd9b78e95ff2928e6 Mon Sep 17 00:00:00 2001 From: Peter Marko Date: Thu, 13 Nov 2025 13:28:05 +0100 Subject: [PATCH] oeqa: fix package detection in go sdk tests The test are skipped if architecture contains dash because TARGET_ARCH contains underscore while package name contains dash. Here the translation needs to be done. Note that poky distro default arch has dash: MACHINE="qemux86-64" TARGET_ARCH="x86_64" ERROR: Nothing PROVIDES 'go-cross-canadian-x86_64'. Close matches: gcc-cross-canadian-x86-64 gdb-cross-canadian-x86-64 go-cross-canadian-x86-64 TRANSLATED_TARGET_ARCH="x86-64" Quoting meta/classes-recipe/cross-canadian.bbclass: TRANSLATED_TARGET_ARCH is added into PN (From OE-Core rev: 82a46b70bfba7c4ce4fd20e2658b182b03e55037) Signed-off-by: Peter Marko Signed-off-by: Steve Sakoman --- meta/lib/oeqa/sdk/cases/go.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/lib/oeqa/sdk/cases/go.py b/meta/lib/oeqa/sdk/cases/go.py index a050df7a9f..693be89e1d 100644 --- a/meta/lib/oeqa/sdk/cases/go.py +++ b/meta/lib/oeqa/sdk/cases/go.py @@ -25,9 +25,9 @@ class GoCompileTest(OESDKTestCase): os.path.join(self.tc.sdk_dir, 'test.go')) def setUp(self): - target_arch = self.td.get("TARGET_ARCH") + translated_target_arch = self.td.get("TRANSLATED_TARGET_ARCH") # Check for go-cross-canadian package (uses target architecture) - if not self.tc.hasHostPackage("go-cross-canadian-%s" % target_arch): + if not self.tc.hasHostPackage("go-cross-canadian-%s" % translated_target_arch): raise unittest.SkipTest("GoCompileTest class: SDK doesn't contain a Go cross-canadian toolchain") # Additional runtime check for go command availability @@ -63,9 +63,9 @@ class GoHostCompileTest(OESDKTestCase): os.path.join(self.tc.sdk_dir, 'test.go')) def setUp(self): - target_arch = self.td.get("TARGET_ARCH") + translated_target_arch = self.td.get("TRANSLATED_TARGET_ARCH") # Check for go-cross-canadian package (uses target architecture) - if not self.tc.hasHostPackage("go-cross-canadian-%s" % target_arch): + if not self.tc.hasHostPackage("go-cross-canadian-%s" % translated_target_arch): raise unittest.SkipTest("GoHostCompileTest class: SDK doesn't contain a Go cross-canadian toolchain") # Additional runtime check for go command availability