PREFLIGHT-TOOL-AVAILABLE-SPACES: parse quoted paths with spaces in make_game.tool_available #482

Manually merged
github merged 1 commit from gh-pr/482/head into gh-pr/482/base 2026-11-26 09:03:12 +00:00
Owner

@⁠xroneyaa on GitHub · 2026-11-24 06:10 UTC · original
xroneyaa:fix/make-game-tool-available-spaces → main · +19 −5 · 2 files · 1 commits · merged 2026-11-25 21:23 UTC

Claimed in the coordination issue as: PREFLIGHT-TOOL-AVAILABLE-SPACES

What and why

make_game.tool_available() previously stripped outer quotes and split on whitespace (cmd.split()[0]). When passed a quoted path containing spaces plus arguments (such as "C:\Program Files\Python312\python.exe" -I), it split at the first space (C:\Program) and reported an available tool as missing, failing ToolchainDetectionTest.test_tool_available_command_with_arguments on Windows systems where Python is installed under Program Files.

This reuses tools/mc_command.py's split_command() so quoted paths with spaces and arguments resolve to their executable path, unquoted paths with spaces still resolve via os.path.isfile(), and unmatched quotes return False without raising SystemExit. Added space-in-path and unmatched-quote regression tests in tests/test_make_game_preflight.py.

Tested

  • python -I -m compileall -q make_game.py tests -> exit 0
  • python -I tests/test_make_game_preflight.py -> Ran 100 tests, OK (skipped=1)
  • python -I tests/test_make_game_argparse.py -> Ran 38 tests, OK
  • python -I tests/test_text_write_line_endings.py -> Ran 3 tests, OK
  • python -I scripts/check_no_game_data.py make_game.py tests/test_make_game_preflight.py -> exit 0

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed (n/a — no translator rule added).
**@⁠xroneyaa** on GitHub · 2026-11-24 06:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/482) `xroneyaa:fix/make-game-tool-available-spaces` → `main` · +19 −5 · 2 files · 1 commits · merged 2026-11-25 21:23 UTC Claimed in the coordination issue as: PREFLIGHT-TOOL-AVAILABLE-SPACES ### What and why `make_game.tool_available()` previously stripped outer quotes and split on whitespace (`cmd.split()[0]`). When passed a quoted path containing spaces plus arguments (such as `"C:\Program Files\Python312\python.exe" -I`), it split at the first space (`C:\Program`) and reported an available tool as missing, failing `ToolchainDetectionTest.test_tool_available_command_with_arguments` on Windows systems where Python is installed under `Program Files`. This reuses `tools/mc_command.py`'s `split_command()` so quoted paths with spaces and arguments resolve to their executable path, unquoted paths with spaces still resolve via `os.path.isfile()`, and unmatched quotes return `False` without raising `SystemExit`. Added space-in-path and unmatched-quote regression tests in `tests/test_make_game_preflight.py`. ### Tested - `python -I -m compileall -q make_game.py tests` -> exit 0 - `python -I tests/test_make_game_preflight.py` -> Ran 100 tests, OK (skipped=1) - `python -I tests/test_make_game_argparse.py` -> Ran 38 tests, OK - `python -I tests/test_text_write_line_endings.py` -> Ran 3 tests, OK - `python -I scripts/check_no_game_data.py make_game.py tests/test_make_game_preflight.py` -> exit 0 GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed (n/a — no translator rule added).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:03:10 +00:00
github manually merged commit 2c03f29783 into gh-pr/482/base 2026-11-26 09:03:12 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-24 20:56 UTC · original

Reviewed 2c03f29: ran tests/test_make_game_preflight.py on the PR (Ran 100 tests, OK (skipped=1)) and copied onto main, where it fails only on the new quoted-path-with-arguments assertion (False on main, True on the PR; the unmatched-quote test passes on both and guards split_command's SystemExit). tests/test_make_game_argparse.py passes on both trees (38 tests, OK (skipped=1)). Differential probes show no regressions: on Linux, single-quoted paths and escaped spaces also flip False -> True while malformed/unclosed-quote inputs flip True -> False (matching split_command), and mocking os.name == "nt" exercises the MSVC path cleanly (native Windows still untested). tests/test_mc_command.py has 2 identical failures on plain main (sandbox /tmp noexec), unrelated to this PR. AI-assisted review.

**@⁠PierreEbele** on GitHub · 2026-11-24 20:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/482#issuecomment-7144261837) Reviewed 2c03f29: ran tests/test_make_game_preflight.py on the PR (`Ran 100 tests`, `OK (skipped=1)`) and copied onto main, where it fails only on the new quoted-path-with-arguments assertion (`False` on main, `True` on the PR; the unmatched-quote test passes on both and guards `split_command`'s `SystemExit`). tests/test_make_game_argparse.py passes on both trees (`38 tests`, `OK (skipped=1)`). Differential probes show no regressions: on Linux, single-quoted paths and escaped spaces also flip `False -> True` while malformed/unclosed-quote inputs flip `True -> False` (matching `split_command`), and mocking `os.name == "nt"` exercises the MSVC path cleanly (native Windows still untested). tests/test_mc_command.py has 2 identical failures on plain main (sandbox `/tmp` `noexec`), unrelated to this PR. AI-assisted review.
Author
Owner

@⁠DeadlyChirp on GitHub · 2026-11-25 15:11 UTC · original

Tested on Windows 11, Python 3.12.10 (venv under D:\GTA 6 TEMP\venv, a path with spaces). I merged 2c03f2978 onto upstream main (merge commit eab4a9f99).

  • python -I tests/test_make_game_preflight.py: 100 tests OK (2 skipped). On main, test_tool_available_command_with_arguments fails here with AssertionError: False is not true, because sys.executable has a space.
  • Direct check of make_game.tool_available(...):
command main this PR
"D:\GTA 6 TEMP\venv\Scripts\python.exe" -I False True
"D:\nope dir\x.exe" -I (missing) False False
E:/dev/mamba/llvm/Library/bin/llvm-mc.exe True True

LGTM from the Windows side.

(AI-assisted test run; output checked by hand.)

**@⁠DeadlyChirp** on GitHub · 2026-11-25 15:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/482#issuecomment-7166445212) Tested on Windows 11, Python 3.12.10 (venv under `D:\GTA 6 TEMP\venv`, a path with spaces). I merged 2c03f2978 onto upstream main (merge commit eab4a9f99). - `python -I tests/test_make_game_preflight.py`: 100 tests OK (2 skipped). On main, `test_tool_available_command_with_arguments` fails here with `AssertionError: False is not true`, because `sys.executable` has a space. - Direct check of `make_game.tool_available(...)`: | command | main | this PR | |---|---|---| | `"D:\GTA 6 TEMP\venv\Scripts\python.exe" -I` | False | True | | `"D:\nope dir\x.exe" -I` (missing) | False | False | | `E:/dev/mamba/llvm/Library/bin/llvm-mc.exe` | True | True | LGTM from the Windows side. (AI-assisted test run; output checked by hand.)
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 21:23 UTC · original

Merged, thanks! The new test fails on main and passes with this.

  • Checked on main 2b78ecb22 + 2c03f2978: the semantic suite passes (491 files, 6,312 tests, 0 files failed); test_make_game_preflight pass; the 15 docs and writer tests pass; check_no_game_data.py is clean on the 2 changed files.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 21:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/482#issuecomment-7175022800) Merged, thanks! The new test fails on `main` and passes with this. - **Checked on `main` `2b78ecb22` + `2c03f2978`:** the semantic suite passes (491 files, 6,312 tests, 0 files failed); `test_make_game_preflight` pass; the 15 docs and writer tests pass; `check_no_game_data.py` is clean on the 2 changed files. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.