Preserve the Windows wrapper's child exit status when the child exits with 0xffffffff, rather than reporting a startup error and exiting with 1.
Draft follow-up to #36105. @ryanofsky, 1300cb1a5b is the only additional commit and can be folded into your branch. This branch includes the four prerequisite commits and should not be merged independently.
At 30ae05a21bdb30e63400385cf6d9dfd87dccfc70, _spawnvp(_P_WAIT) uses the same return value for a valid child status of -1 and a spawn failure. Starting with _P_NOWAIT and waiting with _cwait separates the wait result from the child's exit status. The regression uses a temporary copy of the Windows command interpreter as the child, with fixed exit codes 0, 1 and -1.
AI disclosure: Codex prepared the patch, ran the checks below, and wrote/submitted this draft at the account owner's request. Human review is pending.
Validation on native Windows 11 build 26200, Clang 22.1.8 / UCRT, Release, warnings as errors:
- The new regression with the original PR launcher fails at
not(1 == 4294967295). - With the correction,
tool_bitcoin.pypasses, including its existing non-IPC checks. - Native
bitcoin,bitcoindandbitcoin-clibuilds, eight controlled launcher comparisons, and changed-file Ruff checks pass.
For a configured native build:
cmake --build build --target bitcoin bitcoind bitcoin-cli
python test/functional/tool_bitcoin.py --configfile=build/test/config.ini --tmpdir=build/tool-bitcoin-exit-status
Use a fresh test directory on repeated runs. Wallet, GUI and IPC were disabled. The full unit suite, GUI test and a fully MSVCRT-linked build were not tested.