* [PATCH] bin: Hide os.fork() deprecation warning at module level
@ 2026-02-05 14:13 Mathieu Dubois-Briand
2026-02-05 15:29 ` [bitbake-devel] " Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Dubois-Briand @ 2026-02-05 14:13 UTC (permalink / raw)
To: bitbake-devel; +Cc: Thomas Petazzoni, Mathieu Dubois-Briand, Chen Qi
Add the message filtering directly in the python module where the error
happens, so we do not need to repeat the filter in all consumers. This
will also make sure the filter is applied in any user of createDaemon().
Fixes [YOCTO #16080]
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Suggested-by: Chen Qi <Qi.Chen@windriver.com>
---
bin/bitbake | 1 -
bin/bitbake-layers | 1 -
bin/bitbake-server | 1 -
bin/bitbake-worker | 1 -
lib/bb/daemonize.py | 3 +++
5 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/bin/bitbake b/bin/bitbake
index 2eb5f9103d31..a995bd665352 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -14,7 +14,6 @@ import os
import sys
import warnings
warnings.simplefilter("default")
-warnings.filterwarnings("ignore", category=DeprecationWarning, message=".*use.of.fork.*may.lead.to.deadlocks.in.the.child.*")
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)),
'lib'))
diff --git a/bin/bitbake-layers b/bin/bitbake-layers
index 37c196226cbe..c49a5f30eef4 100755
--- a/bin/bitbake-layers
+++ b/bin/bitbake-layers
@@ -16,7 +16,6 @@ import sys
import argparse
import warnings
warnings.simplefilter("default")
-warnings.filterwarnings("ignore", category=DeprecationWarning, message=".*use.of.fork.*may.lead.to.deadlocks.in.the.child.*")
bindir = os.path.dirname(__file__)
toolname = os.path.basename(__file__).split(".")[0]
diff --git a/bin/bitbake-server b/bin/bitbake-server
index 01f83d982f0c..1428f72a7e57 100755
--- a/bin/bitbake-server
+++ b/bin/bitbake-server
@@ -9,7 +9,6 @@ import os
import sys
import warnings
warnings.simplefilter("default")
-warnings.filterwarnings("ignore", category=DeprecationWarning, message=".*use.of.fork.*may.lead.to.deadlocks.in.the.child.*")
import logging
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
diff --git a/bin/bitbake-worker b/bin/bitbake-worker
index d2b146a6a92f..d522ca54b7f8 100755
--- a/bin/bitbake-worker
+++ b/bin/bitbake-worker
@@ -9,7 +9,6 @@ import os
import sys
import warnings
warnings.simplefilter("default")
-warnings.filterwarnings("ignore", category=DeprecationWarning, message=".*use.of.fork.*may.lead.to.deadlocks.in.the.child.*")
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
from bb import fetch2
import logging
diff --git a/lib/bb/daemonize.py b/lib/bb/daemonize.py
index 76894044363e..70d9b8ee0e70 100644
--- a/lib/bb/daemonize.py
+++ b/lib/bb/daemonize.py
@@ -15,9 +15,12 @@ import os
import sys
import io
import traceback
+import warnings
import bb
+warnings.filterwarnings("ignore", category=DeprecationWarning, message=".*use.of.fork.*may.lead.to.deadlocks.in.the.child.*")
+
def createDaemon(function, logfile):
"""
Detach a process from the controlling terminal and run it in the
---
base-commit: 921e4ce1e030e4c8c3ecd5d6ffc7343df473d13c
change-id: 20260205-mathieu-fork-warning-filter-9b867e1c6acb
Best regards,
--
Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [bitbake-devel] [PATCH] bin: Hide os.fork() deprecation warning at module level
2026-02-05 14:13 [PATCH] bin: Hide os.fork() deprecation warning at module level Mathieu Dubois-Briand
@ 2026-02-05 15:29 ` Richard Purdie
2026-02-05 17:03 ` Mathieu Dubois-Briand
0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2026-02-05 15:29 UTC (permalink / raw)
To: mathieu.dubois-briand, bitbake-devel; +Cc: Thomas Petazzoni, Chen Qi
On Thu, 2026-02-05 at 15:13 +0100, Mathieu Dubois-Briand via lists.openembedded.org wrote:
> Add the message filtering directly in the python module where the error
> happens, so we do not need to repeat the filter in all consumers. This
> will also make sure the filter is applied in any user of createDaemon().
>
> Fixes [YOCTO #16080]
>
> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
> Suggested-by: Chen Qi <Qi.Chen@windriver.com>
> ---
> bin/bitbake | 1 -
> bin/bitbake-layers | 1 -
> bin/bitbake-server | 1 -
> bin/bitbake-worker | 1 -
Nearly! :)
You need to leave bitbake-worker alone as it has a different use of
os.fork().
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [bitbake-devel] [PATCH] bin: Hide os.fork() deprecation warning at module level
2026-02-05 15:29 ` [bitbake-devel] " Richard Purdie
@ 2026-02-05 17:03 ` Mathieu Dubois-Briand
0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Dubois-Briand @ 2026-02-05 17:03 UTC (permalink / raw)
To: Richard Purdie, bitbake-devel; +Cc: Thomas Petazzoni, Chen Qi
On Thu Feb 5, 2026 at 4:29 PM CET, Richard Purdie wrote:
> On Thu, 2026-02-05 at 15:13 +0100, Mathieu Dubois-Briand via lists.openembedded.org wrote:
>> Add the message filtering directly in the python module where the error
>> happens, so we do not need to repeat the filter in all consumers. This
>> will also make sure the filter is applied in any user of createDaemon().
>>
>> Fixes [YOCTO #16080]
>>
>> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
>> Suggested-by: Chen Qi <Qi.Chen@windriver.com>
>> ---
>> bin/bitbake | 1 -
>> bin/bitbake-layers | 1 -
>> bin/bitbake-server | 1 -
>> bin/bitbake-worker | 1 -
>
> Nearly! :)
>
> You need to leave bitbake-worker alone as it has a different use of
> os.fork().
>
Right! I missed that point, sending a v2.
Thanks,
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-05 17:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-05 14:13 [PATCH] bin: Hide os.fork() deprecation warning at module level Mathieu Dubois-Briand
2026-02-05 15:29 ` [bitbake-devel] " Richard Purdie
2026-02-05 17:03 ` 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