Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] oeqa httpserver.py: fallback for multiprocessing import without bitbake
@ 2025-11-21 10:59 Mikko Rapeli
  2025-11-21 13:27 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Mikko Rapeli @ 2025-11-21 10:59 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mikko Rapeli

When testexport.bbclass is used, then build environment and bitbake
may not be available when oeqa tests run.

Fixes oeqa test execution:

https://ledge.validation.linaro.org/scheduler/job/123974

ImportError: Failed to import test module: apt
Traceback (most recent call last):
  File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/lava-downloads/core-image-sato/meta/lib/oeqa/runtime/cases/apt.py", line 8, in <module>
    from oeqa.utils.httpserver import HTTPService
  File "/lava-downloads/core-image-sato/meta/lib/oeqa/utils/httpserver.py", line 9, in <module>
    from bb import multiprocessing
ModuleNotFoundError: No module named 'bb'

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta/lib/oeqa/utils/httpserver.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/utils/httpserver.py b/meta/lib/oeqa/utils/httpserver.py
index 9e61cd89d5..cd42d3ed4c 100644
--- a/meta/lib/oeqa/utils/httpserver.py
+++ b/meta/lib/oeqa/utils/httpserver.py
@@ -6,7 +6,10 @@
 
 import http.server
 import logging
-from bb import multiprocessing
+try:
+    from bb import multiprocessing
+except ImportError:
+    import multiprocessing
 import os
 import signal
 from socketserver import ThreadingMixIn
-- 
2.34.1



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

* Re: [OE-core] [PATCH] oeqa httpserver.py: fallback for multiprocessing import without bitbake
  2025-11-21 10:59 [PATCH] oeqa httpserver.py: fallback for multiprocessing import without bitbake Mikko Rapeli
@ 2025-11-21 13:27 ` Richard Purdie
  2025-11-21 13:30   ` Mikko Rapeli
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2025-11-21 13:27 UTC (permalink / raw)
  To: mikko.rapeli, openembedded-core

On Fri, 2025-11-21 at 12:59 +0200, Mikko Rapeli via lists.openembedded.org wrote:
> When testexport.bbclass is used, then build environment and bitbake
> may not be available when oeqa tests run.
> 
> Fixes oeqa test execution:
> 
> https://ledge.validation.linaro.org/scheduler/job/123974
> 
> ImportError: Failed to import test module: apt
> Traceback (most recent call last):
>   File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
>     module = self._get_module_from_name(name)
>   File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
>     __import__(name)
>     ~~~~~~~~~~^^^^^^
>   File "/lava-downloads/core-image-sato/meta/lib/oeqa/runtime/cases/apt.py", line 8, in <module>
>     from oeqa.utils.httpserver import HTTPService
>   File "/lava-downloads/core-image-sato/meta/lib/oeqa/utils/httpserver.py", line 9, in <module>
>     from bb import multiprocessing
> ModuleNotFoundError: No module named 'bb'

Breaks with python 3.14.

Cheers,

Richard


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

* Re: [OE-core] [PATCH] oeqa httpserver.py: fallback for multiprocessing import without bitbake
  2025-11-21 13:27 ` [OE-core] " Richard Purdie
@ 2025-11-21 13:30   ` Mikko Rapeli
  2025-11-21 13:34     ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Mikko Rapeli @ 2025-11-21 13:30 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

Hi,

On Fri, Nov 21, 2025 at 01:27:56PM +0000, Richard Purdie wrote:
> On Fri, 2025-11-21 at 12:59 +0200, Mikko Rapeli via lists.openembedded.org wrote:
> > When testexport.bbclass is used, then build environment and bitbake
> > may not be available when oeqa tests run.
> > 
> > Fixes oeqa test execution:
> > 
> > https://ledge.validation.linaro.org/scheduler/job/123974
> > 
> > ImportError: Failed to import test module: apt
> > Traceback (most recent call last):
> > � File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
> > ��� module = self._get_module_from_name(name)
> > � File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
> > ��� __import__(name)
> > ��� ~~~~~~~~~~^^^^^^
> > � File "/lava-downloads/core-image-sato/meta/lib/oeqa/runtime/cases/apt.py", line 8, in <module>
> > ��� from oeqa.utils.httpserver import HTTPService
> > � File "/lava-downloads/core-image-sato/meta/lib/oeqa/utils/httpserver.py", line 9, in <module>
> > ��� from bb import multiprocessing
> > ModuleNotFoundError: No module named 'bb'
> 
> Breaks with python 3.14.

Understood but this would fix current test setups which still have python 3.13.

Cheers,

-Mikko


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

* Re: [OE-core] [PATCH] oeqa httpserver.py: fallback for multiprocessing import without bitbake
  2025-11-21 13:30   ` Mikko Rapeli
@ 2025-11-21 13:34     ` Richard Purdie
  2025-11-21 13:39       ` Mikko Rapeli
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2025-11-21 13:34 UTC (permalink / raw)
  To: Mikko Rapeli; +Cc: openembedded-core

On Fri, 2025-11-21 at 15:30 +0200, Mikko Rapeli wrote:
> Hi,
> 
> On Fri, Nov 21, 2025 at 01:27:56PM +0000, Richard Purdie wrote:
> > On Fri, 2025-11-21 at 12:59 +0200, Mikko Rapeli via
> > lists.openembedded.org wrote:
> > > When testexport.bbclass is used, then build environment and
> > > bitbake
> > > may not be available when oeqa tests run.
> > > 
> > > Fixes oeqa test execution:
> > > 
> > > https://ledge.validation.linaro.org/scheduler/job/123974
> > > 
> > > ImportError: Failed to import test module: apt
> > > Traceback (most recent call last):
> > >   File "/usr/lib/python3.13/unittest/loader.py", line 396, in
> > > _find_test_path
> > >     module = self._get_module_from_name(name)
> > >   File "/usr/lib/python3.13/unittest/loader.py", line 339, in
> > > _get_module_from_name
> > >     __import__(name)
> > >     ~~~~~~~~~~^^^^^^
> > >   File "/lava-downloads/core-image-
> > > sato/meta/lib/oeqa/runtime/cases/apt.py", line 8, in <module>
> > >     from oeqa.utils.httpserver import HTTPService
> > >   File "/lava-downloads/core-image-
> > > sato/meta/lib/oeqa/utils/httpserver.py", line 9, in <module>
> > >     from bb import multiprocessing
> > > ModuleNotFoundError: No module named 'bb'
> > 
> > Breaks with python 3.14.
> 
> Understood but this would fix current test setups which still have
> python 3.13.

Where should we document that testexport only works if you have 3.13 or
lower and not with 3.14? Who is going to maintain these requirements?
This "not needing bb" requirement isn't really working well.

I'd rather require lib/bb be present and included in the exported test
data for example.

Cheers,

Richard





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

* Re: [OE-core] [PATCH] oeqa httpserver.py: fallback for multiprocessing import without bitbake
  2025-11-21 13:34     ` Richard Purdie
@ 2025-11-21 13:39       ` Mikko Rapeli
  0 siblings, 0 replies; 5+ messages in thread
From: Mikko Rapeli @ 2025-11-21 13:39 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

Hi,

On Fri, Nov 21, 2025 at 01:34:44PM +0000, Richard Purdie wrote:
> On Fri, 2025-11-21 at 15:30 +0200, Mikko Rapeli wrote:
> > Hi,
> > 
> > On Fri, Nov 21, 2025 at 01:27:56PM +0000, Richard Purdie wrote:
> > > On Fri, 2025-11-21 at 12:59 +0200, Mikko Rapeli via
> > > lists.openembedded.org wrote:
> > > > When testexport.bbclass is used, then build environment and
> > > > bitbake
> > > > may not be available when oeqa tests run.
> > > > 
> > > > Fixes oeqa test execution:
> > > > 
> > > > https://ledge.validation.linaro.org/scheduler/job/123974
> > > > 
> > > > ImportError: Failed to import test module: apt
> > > > Traceback (most recent call last):
> > > > � File "/usr/lib/python3.13/unittest/loader.py", line 396, in
> > > > _find_test_path
> > > > ��� module = self._get_module_from_name(name)
> > > > � File "/usr/lib/python3.13/unittest/loader.py", line 339, in
> > > > _get_module_from_name
> > > > ��� __import__(name)
> > > > ��� ~~~~~~~~~~^^^^^^
> > > > � File "/lava-downloads/core-image-
> > > > sato/meta/lib/oeqa/runtime/cases/apt.py", line 8, in <module>
> > > > ��� from oeqa.utils.httpserver import HTTPService
> > > > � File "/lava-downloads/core-image-
> > > > sato/meta/lib/oeqa/utils/httpserver.py", line 9, in <module>
> > > > ��� from bb import multiprocessing
> > > > ModuleNotFoundError: No module named 'bb'
> > > 
> > > Breaks with python 3.14.
> > 
> > Understood but this would fix current test setups which still have
> > python 3.13.
> 
> Where should we document that testexport only works if you have 3.13 or
> lower and not with 3.14? Who is going to maintain these requirements?
> This "not needing bb" requirement isn't really working well.
> 
> I'd rather require lib/bb be present and included in the exported test
> data for example.

I agree this is the long term fix. If you don't want a "quick fix to unblock
testing" then I need to look into that. I was hoping to keep changes to
master branch minimal until release done.

Cheers,

-Mikko


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

end of thread, other threads:[~2025-11-21 13:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-21 10:59 [PATCH] oeqa httpserver.py: fallback for multiprocessing import without bitbake Mikko Rapeli
2025-11-21 13:27 ` [OE-core] " Richard Purdie
2025-11-21 13:30   ` Mikko Rapeli
2025-11-21 13:34     ` Richard Purdie
2025-11-21 13:39       ` Mikko Rapeli

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