Skip to contentSkip to conversation

bitbake-worker: Use Lock from bb.multiprocessing

PATCH New Joshua Watt 1 participant 1 message Mar 3

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake-worker: Use Lock from bb.multiprocessing

bitbake-worker relies on multiprocessing using the "fork" method to pass data to the child process. Starting in Python 3.13 the default changed to "forkserver", so the bb.multiprocessing context needs to be used in order to preserve the "fork" method.

Note that bb.multiprocessing is a context, so Lock can't be imported from it; instead a local alias for Lock must be used

---
 bin/bitbake-worker | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
bin/bitbake-worker +2 -1
index d2b146a6a..aa14ef191 100755
@@ -23,9 +23,10 @@ import queue
 import shlex
 import subprocess
 import fcntl
-from multiprocessing import Lock
 from threading import Thread
 
+Lock = bb.multiprocessing.Lock
+
 # Remove when we have a minimum of python 3.10
 if not hasattr(fcntl, 'F_SETPIPE_SZ'):
     fcntl.F_SETPIPE_SZ = 1031
Signature · 1 line
2.53.0