public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH V2] qemurunner: Improve qmp module detection PKG_CONFIG_SYSROOT_DIR for qmp module path
@ 2026-01-07 20:25 Tom Geelen
  2026-01-07 20:52 ` Alexander Kanavin
  2026-01-08 11:31 ` [OE-core] " Mathieu Dubois-Briand
  0 siblings, 2 replies; 5+ messages in thread
From: Tom Geelen @ 2026-01-07 20:25 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alex Kanavin, Tom Geelen

Instead of using logfile to detect where qmp is located we can use PKG_CONFIG_SYSROOT_DIR, passed via ENV to the launch function as this will point to the image recipe for which launch is called.

Signed-off-by: Tom Geelen <t.f.g.geelen@gmail.com>
---
 meta/lib/oeqa/utils/qemurunner.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index c4db0cf038..dd1ff42b0f 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -186,11 +186,9 @@ class QemuRunner:
         return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams, env=env)
 
     def launch(self, launch_cmd, get_ip = True, qemuparams = None, extra_bootparams = None, env = None):
-        # use logfile to determine the recipe-sysroot-native path and
-        # then add in the site-packages path components and add that
-        # to the python sys.path so the qmp module can be found.
-        python_path = os.path.dirname(os.path.dirname(self.logfile))
-        python_path += "/recipe-sysroot-native/usr/lib/qemu-python"
+        # Use PKG_CONFIG_SYSROOT_DIR from env as a starting point for finding qmp module
+        python_path = env.get("PKG_CONFIG_SYSROOT_DIR", "")
+        python_path += "/../recipe-sysroot-native/usr/lib/qemu-python"
         sys.path.append(python_path)
         importlib.invalidate_caches()
         try:
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] qemurunner: Improve qmp module detection PKG_CONFIG_SYSROOT_DIR for qmp module path
  2026-01-07 20:25 [PATCH V2] qemurunner: Improve qmp module detection PKG_CONFIG_SYSROOT_DIR for qmp module path Tom Geelen
@ 2026-01-07 20:52 ` Alexander Kanavin
  2026-01-08 11:31 ` [OE-core] " Mathieu Dubois-Briand
  1 sibling, 0 replies; 5+ messages in thread
From: Alexander Kanavin @ 2026-01-07 20:52 UTC (permalink / raw)
  To: Tom Geelen; +Cc: openembedded-core

On Wed, 7 Jan 2026 at 21:32, Tom Geelen <t.f.g.geelen@gmail.com> wrote:
>      def launch(self, launch_cmd, get_ip = True, qemuparams = None, extra_bootparams = None, env = None):
> -        # use logfile to determine the recipe-sysroot-native path and
> -        # then add in the site-packages path components and add that
> -        # to the python sys.path so the qmp module can be found.
> -        python_path = os.path.dirname(os.path.dirname(self.logfile))
> -        python_path += "/recipe-sysroot-native/usr/lib/qemu-python"
> +        # Use PKG_CONFIG_SYSROOT_DIR from env as a starting point for finding qmp module
> +        python_path = env.get("PKG_CONFIG_SYSROOT_DIR", "")
> +        python_path += "/../recipe-sysroot-native/usr/lib/qemu-python"

Thanks, I'm okay with this. It's not perfect, but it's short and very
unlikely to break.

Alex


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH V2] qemurunner: Improve qmp module detection PKG_CONFIG_SYSROOT_DIR for qmp module path
  2026-01-07 20:25 [PATCH V2] qemurunner: Improve qmp module detection PKG_CONFIG_SYSROOT_DIR for qmp module path Tom Geelen
  2026-01-07 20:52 ` Alexander Kanavin
@ 2026-01-08 11:31 ` Mathieu Dubois-Briand
  2026-01-08 14:52   ` Tom Geelen
  1 sibling, 1 reply; 5+ messages in thread
From: Mathieu Dubois-Briand @ 2026-01-08 11:31 UTC (permalink / raw)
  To: t.f.g.geelen, openembedded-core; +Cc: Alex Kanavin

On Wed Jan 7, 2026 at 9:25 PM CET, Tom Geelen via lists.openembedded.org wrote:
> Instead of using logfile to detect where qmp is located we can use PKG_CONFIG_SYSROOT_DIR, passed via ENV to the launch function as this will point to the image recipe for which launch is called.
>
> Signed-off-by: Tom Geelen <t.f.g.geelen@gmail.com>
> ---

Hi Tom,

Thanks for your patch.

This is failing on the autobuilder, with the following error:

2026-01-08 10:20:15,532 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/qemux86-tc/build/layers/openembedded-core/meta/lib/oeqa/utils/commands.py", line 390, in runqemu
    qemu.start(params=qemuparams, ssh=ssh, runqemuparams=runqemuparams, launch_cmd=launch_cmd, discard_writes=discard_writes)
  File "/srv/pokybuild/yocto-worker/qemux86-tc/build/layers/openembedded-core/meta/lib/oeqa/targetcontrol.py", line 179, in start
    raise RuntimeError("%s - FAILED to start qemu - check the task log and the boot log" % self.pn)
RuntimeError: core-image-minimal - FAILED to start qemu - check the task log and the boot log
...
DEBUG: Using kvm for runqemu
ERROR: qemurunner: qmp module missing, please ensure it's installed in /../recipe-sysroot-native/usr/lib/qemu-python (No module named 'qmp')

https://autobuilder.yoctoproject.org/valkyrie/#/builders/28/builds/2925
https://autobuilder.yoctoproject.org/valkyrie/#/builders/5/builds/2931
https://autobuilder.yoctoproject.org/valkyrie/#/builders/28/builds/2925
https://autobuilder.yoctoproject.org/valkyrie/#/builders/66/builds/2975

Can you have a look at these issues?

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH V2] qemurunner: Improve qmp module detection PKG_CONFIG_SYSROOT_DIR for qmp module path
  2026-01-08 11:31 ` [OE-core] " Mathieu Dubois-Briand
@ 2026-01-08 14:52   ` Tom Geelen
  2026-01-08 17:34     ` Mathieu Dubois-Briand
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Geelen @ 2026-01-08 14:52 UTC (permalink / raw)
  To: Mathieu Dubois-Briand; +Cc: openembedded-core, Alex Kanavin

[-- Attachment #1: Type: text/plain, Size: 2238 bytes --]

Hi Mattieu,

Certainly. Question from my side. What is the exact setup that is used on
the autobuilder? Or the build commands for that matter.
I would like to reproduce this particular setup locally as well.

Regards,

Tom

On Thu, Jan 8, 2026 at 12:31 PM Mathieu Dubois-Briand <
mathieu.dubois-briand@bootlin.com> wrote:

> On Wed Jan 7, 2026 at 9:25 PM CET, Tom Geelen via lists.openembedded.org
> wrote:
> > Instead of using logfile to detect where qmp is located we can use
> PKG_CONFIG_SYSROOT_DIR, passed via ENV to the launch function as this will
> point to the image recipe for which launch is called.
> >
> > Signed-off-by: Tom Geelen <t.f.g.geelen@gmail.com>
> > ---
>
> Hi Tom,
>
> Thanks for your patch.
>
> This is failing on the autobuilder, with the following error:
>
> 2026-01-08 10:20:15,532 - oe-selftest - INFO -
> testtools.testresult.real._StringException: Traceback (most recent call
> last):
>   File
> "/srv/pokybuild/yocto-worker/qemux86-tc/build/layers/openembedded-core/meta/lib/oeqa/utils/commands.py",
> line 390, in runqemu
>     qemu.start(params=qemuparams, ssh=ssh, runqemuparams=runqemuparams,
> launch_cmd=launch_cmd, discard_writes=discard_writes)
>   File
> "/srv/pokybuild/yocto-worker/qemux86-tc/build/layers/openembedded-core/meta/lib/oeqa/targetcontrol.py",
> line 179, in start
>     raise RuntimeError("%s - FAILED to start qemu - check the task log and
> the boot log" % self.pn)
> RuntimeError: core-image-minimal - FAILED to start qemu - check the task
> log and the boot log
> ...
> DEBUG: Using kvm for runqemu
> ERROR: qemurunner: qmp module missing, please ensure it's installed in
> /../recipe-sysroot-native/usr/lib/qemu-python (No module named 'qmp')
>
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/28/builds/2925
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/5/builds/2931
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/28/builds/2925
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/66/builds/2975
>
> Can you have a look at these issues?
>
> Thanks,
> Mathieu
>
> --
> Mathieu Dubois-Briand, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
>

[-- Attachment #2: Type: text/html, Size: 3470 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH V2] qemurunner: Improve qmp module detection PKG_CONFIG_SYSROOT_DIR for qmp module path
  2026-01-08 14:52   ` Tom Geelen
@ 2026-01-08 17:34     ` Mathieu Dubois-Briand
  0 siblings, 0 replies; 5+ messages in thread
From: Mathieu Dubois-Briand @ 2026-01-08 17:34 UTC (permalink / raw)
  To: Tom Geelen; +Cc: openembedded-core, Alex Kanavin

On Thu Jan 8, 2026 at 3:52 PM CET, Tom Geelen wrote:
> Hi Mattieu,
>
> Certainly. Question from my side. What is the exact setup that is used on
> the autobuilder? Or the build commands for that matter.
> I would like to reproduce this particular setup locally as well.
>
> Regards,
>
> Tom
>

Sure!

This is a toolchain test, so the command used by the autobuilder is:
oe-selftest -a -t machine -t toolchain-system -j 15

You have a lot of tests failing, so you might want to just run one
specific test. This can be done with something like:
oe-selftest -r gcc.GccCrossSelfTestSystemEmulated.test_cross_gcc

In terms of configuration, you can have a look at the config step of the
build:
https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/4870597/raw_inline

But basically, you can probably try something like:
SDKMACHINE = "x86_64"
PACKAGE_CLASSES = "package_rpm package_deb package_ipk"
INHERIT += 'image-buildinfo'
IMAGE_BUILDINFO_VARS:append = ' IMAGE_BASENAME IMAGE_NAME'
IMAGE_INSTALL:append = ' ssh-pregen-hostkeys'
SANITY_TESTED_DISTROS = ''
EXTRA_IMAGE_FEATURES ?= 'allow-empty-password empty-root-password allow-root-login'
OE_FRAGMENTS += 'machine/qemux86 distro/poky'

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-08 17:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-07 20:25 [PATCH V2] qemurunner: Improve qmp module detection PKG_CONFIG_SYSROOT_DIR for qmp module path Tom Geelen
2026-01-07 20:52 ` Alexander Kanavin
2026-01-08 11:31 ` [OE-core] " Mathieu Dubois-Briand
2026-01-08 14:52   ` Tom Geelen
2026-01-08 17:34     ` Mathieu Dubois-Briand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox