From e8c5e40d7ab489e3e25374e5668568ce08b4e82d Mon Sep 17 00:00:00 2001 From: Matt Morehouse Date: Mon, 18 May 2026 16:20:26 -0500 Subject: [PATCH 1/2] scripts: force 'fork' multiprocessing when creating sharedir Python 3.14 switched the default to 'forkserver' multiprocessing, which is incompatible with the packer's python scripts. --- scripts/setup-nyx.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/setup-nyx.sh b/scripts/setup-nyx.sh index 7f8c5ef..1f7bd82 100755 --- a/scripts/setup-nyx.sh +++ b/scripts/setup-nyx.sh @@ -61,8 +61,16 @@ echo "Copying packer binaries..." cp "$BINARIES_PATH"/* "$SHAREDIR/" # Generate Nyx config +# Python 3.14 changed the default multiprocessing start method to 'forkserver', +# which breaks the packer's common/debug.py. Force 'fork' to restore the +# pre-3.14 behavior. echo "Generating Nyx config..." -(cd "$PACKER_PATH" && python3 nyx_config_gen.py "$SHAREDIR" Kernel -m 4096) +(cd "$PACKER_PATH" && python3 -c " +import multiprocessing, runpy, sys +multiprocessing.set_start_method('fork', force=True) +sys.argv = ['nyx_config_gen.py'] + sys.argv[1:] +runpy.run_path('nyx_config_gen.py', run_name='__main__') +" "$SHAREDIR" Kernel -m 4096) # Create fuzz_no_pt.sh script echo "Creating fuzz_no_pt.sh..." From 4e5897f01d04d70cb3fd815c83d8b403b08dbaff Mon Sep 17 00:00:00 2001 From: Matt Morehouse Date: Wed, 20 May 2026 13:33:43 -0500 Subject: [PATCH 2/2] scripts: inject sitecustomize.py to force fork Rather than executing a wrapper script that sets the start method to 'fork', we can load a sitecustomize.py file to do it instead. This may work better on NixOS where script shebangs get rewritten. --- scripts/setup-nyx.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/scripts/setup-nyx.sh b/scripts/setup-nyx.sh index 1f7bd82..fef7c65 100755 --- a/scripts/setup-nyx.sh +++ b/scripts/setup-nyx.sh @@ -60,17 +60,19 @@ docker rm "$CONTAINER_ID" > /dev/null echo "Copying packer binaries..." cp "$BINARIES_PATH"/* "$SHAREDIR/" -# Generate Nyx config +# Generate Nyx config. +# # Python 3.14 changed the default multiprocessing start method to 'forkserver', -# which breaks the packer's common/debug.py. Force 'fork' to restore the -# pre-3.14 behavior. +# which breaks the packer's common/debug.py. We force 'fork' via a +# sitecustomize.py injected on PYTHONPATH to restore the pre-3.14 behavior. echo "Generating Nyx config..." -(cd "$PACKER_PATH" && python3 -c " -import multiprocessing, runpy, sys -multiprocessing.set_start_method('fork', force=True) -sys.argv = ['nyx_config_gen.py'] + sys.argv[1:] -runpy.run_path('nyx_config_gen.py', run_name='__main__') -" "$SHAREDIR" Kernel -m 4096) +FORCE_FORK_DIR="$(mktemp -d)" +trap 'rm -rf "$FORCE_FORK_DIR"' EXIT +cat > "$FORCE_FORK_DIR/sitecustomize.py" <<'EOF' +import multiprocessing +multiprocessing.set_start_method("fork", force=True) +EOF +(cd "$PACKER_PATH" && PYTHONPATH="$FORCE_FORK_DIR${PYTHONPATH:+:$PYTHONPATH}" ./nyx_config_gen.py "$SHAREDIR" Kernel -m 4096) # Create fuzz_no_pt.sh script echo "Creating fuzz_no_pt.sh..."