bin: Hide os.fork() deprecation warning at module level
PATCH 1/1 bin: Hide os.fork() deprecation warning at module level
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]
--- 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(-)
bin/bitbake +0 -1
@@ -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'))
bin/bitbake-layers +0 -1
@@ -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]
bin/bitbake-server +0 -1
@@ -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'))
bin/bitbake-worker +0 -1
@@ -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
lib/bb/daemonize.py +3 -0
@@ -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,
Signature · 1 line
Mathieu Dubois-Briand <[email protected]>
Quoted 6 lines · Mathieu Dubois-Briand via lists.openembedded.org
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]
Quoted 7 lines
Signed-off-by Mathieu Dubois-Briand <[email protected]>Suggested-by Chen Qi <[email protected]>---
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
Quoted 15 lines · Richard Purdie
Quoted 6 lines · Mathieu Dubois-Briand via lists.openembedded.org
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]
Quoted 7 lines
Signed-off-by Mathieu Dubois-Briand <[email protected]>Suggested-by Chen Qi <[email protected]>---
bin/bitbake | 1 -bin/bitbake-layers | 1 - bin/bitbake-server | 1 - bin/bitbake-worker | 1 -
Quoted 5 lines
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
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com