All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trevor Woerner <twoerner@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/3] oeqa/sdk: name the commands the host tool cases need
Date: Sun, 30 Aug 2026 14:36:15 -0400	[thread overview]
Message-ID: <20260830183616.4026354-2-twoerner@gmail.com> (raw)
In-Reply-To: <20260830183616.4026354-1-twoerner@gmail.com>

These cases identify a tool only by the package carrying it, so they run
whatever the build host provides. gtk3 shows this is not confined to
eSDKs: its glib-2.0-utils check passes on a standard SDK while
glib-compile-resources and glib-mkenums both resolve to /usr/bin.

perl needs two names because the recipe installs it twice:
nativesdk-perl creates ${bindir}/perl, and perl-native creates
${bindir}/perl-native/perl, kept off PATH so recipes running "env perl"
do not find it.

AI-Generated: codex/claude-opus 5 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 meta/lib/oeqa/sdk/cases/gtk3.py    | 3 ++-
 meta/lib/oeqa/sdk/cases/maturin.py | 8 +++++---
 meta/lib/oeqa/sdk/cases/meson.py   | 2 +-
 meta/lib/oeqa/sdk/cases/perl.py    | 4 ++--
 meta/lib/oeqa/sdk/cases/python.py  | 2 +-
 meta/lib/oeqa/sdk/cases/rust.py    | 2 ++
 6 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/meta/lib/oeqa/sdk/cases/gtk3.py b/meta/lib/oeqa/sdk/cases/gtk3.py
index cdaf50ed3842..336df6491c77 100644
--- a/meta/lib/oeqa/sdk/cases/gtk3.py
+++ b/meta/lib/oeqa/sdk/cases/gtk3.py
@@ -18,7 +18,8 @@ class GTK3Test(MesonTestBase):
     def setUp(self):
         super().setUp()
         self.ensure_target_package("gtk+3", "libgtk-3.0", recipe="gtk+3")
-        self.ensure_host_package("glib-2.0-utils", "libglib-2.0-utils", recipe="glib-2.0")
+        self.ensure_host_package("glib-2.0-utils", "libglib-2.0-utils",
+                                 recipe="glib-2.0", binary="glib-compile-resources")
 
     """
     Test that autotools and GTK+ 3 compiles correctly.
diff --git a/meta/lib/oeqa/sdk/cases/maturin.py b/meta/lib/oeqa/sdk/cases/maturin.py
index e3e8edc7819c..1476e6f19a38 100644
--- a/meta/lib/oeqa/sdk/cases/maturin.py
+++ b/meta/lib/oeqa/sdk/cases/maturin.py
@@ -16,10 +16,12 @@ errors_have_output()
 
 class MaturinTest(OESDKTestCase):
     def setUp(self):
-        self.ensure_host_package("python3-maturin")
+        self.ensure_host_package("python3-maturin", binary="maturin")
+        self.python3 = self.ensure_host_package("python3-core", recipe="python3",
+                                                binary="python3")
 
     def test_maturin_list_python(self):
-        out = self._run(r"""python3 -c 'import sys; print(f"{sys.executable}\n{sys.version_info.major}.{sys.version_info.minor}")'""")
+        out = self._run(r"""%s -c 'import sys; print(f"{sys.executable}\n{sys.version_info.major}.{sys.version_info.minor}")'""" % self.python3)
         executable, version = out.splitlines()
 
         output = self._run("maturin list-python")
@@ -32,7 +34,7 @@ class MaturinTest(OESDKTestCase):
 class MaturinDevelopTest(OESDKTestCase):
     def setUp(self):
         machine = self.td.get("MACHINE")
-        self.ensure_host_package("python3-maturin")
+        self.ensure_host_package("python3-maturin", binary="maturin")
 
         if not (
             self.tc.hasHostPackage("packagegroup-rust-cross-canadian-%s" % machine)
diff --git a/meta/lib/oeqa/sdk/cases/meson.py b/meta/lib/oeqa/sdk/cases/meson.py
index 7540d8ba5539..04ab22c73cf1 100644
--- a/meta/lib/oeqa/sdk/cases/meson.py
+++ b/meta/lib/oeqa/sdk/cases/meson.py
@@ -25,7 +25,7 @@ class MesonTestBase(OESDKTestCase):
             self.skipTest(f"{self.id()} does not support eSDK (https://bugzilla.yoctoproject.org/show_bug.cgi?id=15854)")
 
         self.ensure_host_package("meson")
-        self.ensure_host_package("pkgconf")
+        self.ensure_host_package("pkgconf", binary="pkg-config")
 
     def build_meson(self, sourcedir, builddir, installdir=None, options=""):
         """
diff --git a/meta/lib/oeqa/sdk/cases/perl.py b/meta/lib/oeqa/sdk/cases/perl.py
index a72bd2461a6b..330d472f2013 100644
--- a/meta/lib/oeqa/sdk/cases/perl.py
+++ b/meta/lib/oeqa/sdk/cases/perl.py
@@ -11,9 +11,9 @@ errors_have_output()
 
 class PerlTest(OESDKTestCase):
     def setUp(self):
-        self.ensure_host_package("perl")
+        self.perl = self.ensure_host_package("perl", binary=("perl", "nativeperl"))
 
     def test_perl(self):
-        cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'"
+        cmd = "%s -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'" % self.perl
         output = self._run(cmd)
         self.assertEqual(output, "Hello, world")
diff --git a/meta/lib/oeqa/sdk/cases/python.py b/meta/lib/oeqa/sdk/cases/python.py
index b990cd889ad9..cbc7fb69b2d1 100644
--- a/meta/lib/oeqa/sdk/cases/python.py
+++ b/meta/lib/oeqa/sdk/cases/python.py
@@ -11,7 +11,7 @@ errors_have_output()
 
 class Python3Test(OESDKTestCase):
     def setUp(self):
-        self.ensure_host_package("python3-core", recipe="python3")
+        self.ensure_host_package("python3-core", recipe="python3", binary="python3")
 
     def test_python3(self):
         cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
diff --git a/meta/lib/oeqa/sdk/cases/rust.py b/meta/lib/oeqa/sdk/cases/rust.py
index 4b115bebf521..20e05089af1b 100644
--- a/meta/lib/oeqa/sdk/cases/rust.py
+++ b/meta/lib/oeqa/sdk/cases/rust.py
@@ -29,6 +29,7 @@ class RustCompileTest(OESDKTestCase):
         machine = self.td.get("MACHINE")
         if not self.tc.hasHostPackage("packagegroup-rust-cross-canadian-%s" % machine):
             raise unittest.SkipTest("RustCompileTest class: SDK doesn't contain a Rust cross-canadian toolchain")
+        self.ensure_sdk_binary("cargo")
 
     def test_cargo_build(self):
         self._run('cd %s/hello; cargo add zstd' % (self.tc.sdk_dir))
@@ -50,6 +51,7 @@ class RustHostCompileTest(OESDKTestCase):
         machine = self.td.get("MACHINE")
         if not self.tc.hasHostPackage("packagegroup-rust-cross-canadian-%s" % machine):
             raise unittest.SkipTest("RustCompileTest class: SDK doesn't contain a Rust cross-canadian toolchain")
+        self.ensure_sdk_binary("cargo")
 
     def test_cargo_build(self):
         sdksys = self.td.get("SDK_SYS")


  reply	other threads:[~2026-08-30 18:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-30 18:36 [PATCH 1/3] oeqa/sdk: run the SDK's own copy of a host tool Trevor Woerner
2026-08-30 18:36 ` Trevor Woerner [this message]
2026-08-30 18:36 ` [PATCH 3/3] oeqa/sdk: run the Go driver the SDK installs Trevor Woerner
2026-08-31 18:43 ` [OE-core] [PATCH 1/3] oeqa/sdk: run the SDK's own copy of a host tool Mathieu Dubois-Briand
2026-08-31 19:44 ` Richard Purdie
2026-08-31 21:24   ` Trevor Woerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260830183616.4026354-2-twoerner@gmail.com \
    --to=twoerner@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.