You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ci): make pre-push preflight portable on Windows #9610
The repository's linked-worktree pre-push hook cannot run on Windows. A real push from PowerShell reaches .github/scripts/preflight_runner.py and crashes before the wrapped checks start:
AttributeError: module 'signal' has no attribute 'SIGHUP'
at preflight_runner.py:183
The signal-forwarding block has two POSIX-only assumptions:
signal.SIGHUP is referenced unconditionally, but Windows Python does not define it.
os.killpg is used for forwarding, but Windows Python does not expose process-group signaling through that API.
This forces Windows contributors to bypass the pre-push hook even when their local checks pass.
Proposed fix
Register only signal constants that exist on the current platform.
Keep os.killpg process-group forwarding on POSIX.
Fall back to Popen.send_signal() when os.killpg is unavailable.
Preserve handler restoration and lock cleanup.
Add platform-simulation unit tests and run the existing single-flight tests on Windows.
Acceptance criteria
preflight_runner.py -- ... executes successfully on Windows Python.
A normal git push can enter and complete the pre-push single-flight checks without --no-verify.
Regression testing exposed a third Windows-only assumption: process_exists() calls os.kill(pid, 0). On Windows, signal 0 is CTRL_C_EVENT, so the joiner interrupts the shared console instead of probing process existence. I am including an OpenProcess-based existence check in this same fix; this is why the original single-flight test closed the test host stdout.
The first normal-push retest now passes signal registration and Windows PID probing, then reaches Popen and exposes one more POSIX assumption: scripts/pre-push-singleflight passes the extensionless Bash script scripts/pre-push directly to Windows CreateProcess, which returns WinError 2. I am fixing the wrapper to pass an explicit bash interpreter; I will not use shell=True or interpreter guessing.
The second normal-push retest now launches the Bash hook, then exposes a mixed-codepage log boundary: one child emitted a non-UTF-8 byte and the runner aborted while decoding stdout. I am making log decoding loss-tolerant with visible \xNN escapes and starting the runner with python3 -X utf8; a regression test writes an invalid byte and requires both the runner and its persisted log to complete.
changed the title [-]fix(ci): make preflight signal handling portable to Windows[/-][+]fix(ci): make pre-push preflight portable on Windows[/+]on Jul 13, 2026
A normal Windows push exposed one more interpreter-boundary failure after the signal/process fixes: passing a bare bash argv from native Python selected C:\Windows\System32\bash.exe (WSL) on this machine, not the Git Bash interpreter already running the hook. The hook then failed with HCS_E_HYPERV_NOT_INSTALLED before checks started.
The branch now passes the current wrapper $BASH path to preflight_runner.py. A direct Git Bash -> native Windows Python -> same Git Bash probe succeeds, and a regression contract requires -- "$BASH" scripts/pre-push so PATH shadowing cannot return silently.
Activity
tianmind-studio commentedon Jul 13, 2026
Regression testing exposed a third Windows-only assumption:
process_exists()callsos.kill(pid, 0). On Windows, signal 0 isCTRL_C_EVENT, so the joiner interrupts the shared console instead of probing process existence. I am including anOpenProcess-based existence check in this same fix; this is why the original single-flight test closed the test host stdout.tianmind-studio commentedon Jul 13, 2026
The first normal-push retest now passes signal registration and Windows PID probing, then reaches
Popenand exposes one more POSIX assumption:scripts/pre-push-singleflightpasses the extensionless Bash scriptscripts/pre-pushdirectly to WindowsCreateProcess, which returnsWinError 2. I am fixing the wrapper to pass an explicitbashinterpreter; I will not useshell=Trueor interpreter guessing.tianmind-studio commentedon Jul 13, 2026
The second normal-push retest now launches the Bash hook, then exposes a mixed-codepage log boundary: one child emitted a non-UTF-8 byte and the runner aborted while decoding stdout. I am making log decoding loss-tolerant with visible
\xNNescapes and starting the runner withpython3 -X utf8; a regression test writes an invalid byte and requires both the runner and its persisted log to complete.[-]fix(ci): make preflight signal handling portable to Windows[/-][+]fix(ci): make pre-push preflight portable on Windows[/+]tianmind-studio commentedon Jul 13, 2026
A normal Windows push exposed one more interpreter-boundary failure after the signal/process fixes: passing a bare
bashargv from native Python selectedC:\Windows\System32\bash.exe(WSL) on this machine, not the Git Bash interpreter already running the hook. The hook then failed withHCS_E_HYPERV_NOT_INSTALLEDbefore checks started.The branch now passes the current wrapper
$BASHpath topreflight_runner.py. A direct Git Bash -> native Windows Python -> same Git Bash probe succeeds, and a regression contract requires-- "$BASH" scripts/pre-pushso PATH shadowing cannot return silently.