make_game --pick: on macOS, the folder dialog is osascript's choose folder, so it needs no Tkinter (MAKE-GAME-PICK-MACOS) #2185

Merged
Tauwni merged 4 commits from upstream-pr/2185 into main 2026-12-01 15:17:34 +00:00
Tauwni commented 2026-11-26 03:06:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tauwni on 2026-11-26T03:06:58Z.


Claimed in the coordination issue as: MAKE-GAME-PICK-MACOS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7181407725)

What and why

make_game.py --pick opens its folder dialog through Tk on macOS. Homebrew's Python ships without Tkinter (it's a separate [email protected] formula), so on a Mac with Homebrew's Python --pick stops:

The folder dialog couldn't open (No module named '_tkinter'). Give the folder with --game.

osascript is on every Mac, and its choose folder is the system folder dialog. native_picker() now returns it on macOS, the way kdialog and zenity are the native tools on Linux:

  • native_ask: choose folder with prompt … default location …. The prompt and the start folder are passed as argv, not pasted into the script, so a path with quotes needs no escaping. Cancel is AppleScript error -128, which osascript exits 1 with, the code native_ask already treats as cancelled.
  • native_warn: display dialog … with icon caution, also with the message passed as argv.
  • The flow is the same as on Linux: it asks again from the last folder after a warning. If osascript fails to run, it falls back to Tk as before.

Tested

Apple M3, macOS 26.5.1:

  • Both scripts compile with osacompile. The warning dialog showed a message with quotes, a backslash and a newline, passed as argv (run with giving up after 1). The choose folder dialog opened on the home folder. Cancel (error number -128) exits 1.
  • tests/test_make_game_pick.py: 17 tests OK on Python 3.12 and 3.15. New tests cover macOS picking osascript (and nothing when it's missing), the arguments of the ask and the warning, and cancel. The old "None on macOS" case now only covers Windows. All tests/test_make_game*.py are OK.

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.

🤖 Generated with Claude Code

Red checks: from main, not this change

The failing jobs (check, macos-python, stdlib-tests-linux, linux-gpu-tools, macos, windows) fail the same way on main d48a957bb (MEASURED on macOS for the Python tests, 1 run, with the same assertion text; GPU tests READ from this PR's CI logs). The open pull requests that fix them:

Failing on main Fixed by
test_docs_cli_flags #2536
test_make_game_preflight, test_progress_dashboard (repository URL) #2550
test_docs_repo_paths #2552 (all 14 paths; it conflicts with main, a merge is on Tauwni:fix/2552-merge-main, correction)
test_tool_stdout_encoding #2531, plus two scripts on Tauwni:fix/stdout-replace-two-new-scripts (no PR, open PR limit)
test_windows_boot_journal_seed #2514
test_docs_python_deps passes with the fixes above merged
test_build_runtime_fallback #2573 (passes with it, macOS, 1 run)
vk_bindless_dimensions (macOS) #2441
test_docs_env_vars DOC-CLWB-SETTING (fix)
test_make_game_pipelines, test_sampler_source_census, test_spirv_metal_set0_cli_errors, test_spirv_metal_set0_extra, tests/semantic/test_valu_cvt_f16_int16_mods.py, ps_exp_f32_denorm_rt (macOS) branches on Tauwni/leonida, no PR (finding)
cs_imgatomic_ext (macOS, linux-gpu-tools) #1518, closed without a comment
vk_xdxr_postbuild_readback (Windows) already passes on main: merge main

Not checked by a second agent or human yet.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5503252060 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2185). Originally posted by [Tauwni](https://github.com/Tauwni) on 2026-11-26T03:06:58Z. --- Claimed in the coordination issue as: MAKE-GAME-PICK-MACOS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7181407725) ### What and why `make_game.py --pick` opens its folder dialog through Tk on macOS. Homebrew's Python ships without Tkinter (it's a separate `[email protected]` formula), so on a Mac with Homebrew's Python `--pick` stops: ``` The folder dialog couldn't open (No module named '_tkinter'). Give the folder with --game. ``` `osascript` is on every Mac, and its `choose folder` is the system folder dialog. `native_picker()` now returns it on macOS, the way kdialog and zenity are the native tools on Linux: - `native_ask`: `choose folder with prompt … default location …`. The prompt and the start folder are passed as `argv`, not pasted into the script, so a path with quotes needs no escaping. Cancel is AppleScript error -128, which `osascript` exits 1 with, the code `native_ask` already treats as cancelled. - `native_warn`: `display dialog … with icon caution`, also with the message passed as `argv`. - The flow is the same as on Linux: it asks again from the last folder after a warning. If `osascript` fails to run, it falls back to Tk as before. ### Tested Apple M3, macOS 26.5.1: - Both scripts compile with `osacompile`. The warning dialog showed a message with quotes, a backslash and a newline, passed as `argv` (run with `giving up after 1`). The `choose folder` dialog opened on the home folder. Cancel (`error number -128`) exits 1. - `tests/test_make_game_pick.py`: 17 tests OK on Python 3.12 and 3.15. New tests cover macOS picking osascript (and nothing when it's missing), the arguments of the ask and the warning, and cancel. The old "None on macOS" case now only covers Windows. All `tests/test_make_game*.py` are OK. AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ### Red checks: from `main`, not this change The failing jobs (`check`, `macos-python`, `stdlib-tests-linux`, `linux-gpu-tools`, `macos`, `windows`) fail the same way on `main` `d48a957bb` (MEASURED on macOS for the Python tests, 1 run, with the same assertion text; GPU tests READ from this PR's CI logs). The open pull requests that fix them: | Failing on `main` | Fixed by | |---|---| | `test_docs_cli_flags` | #2536 | | `test_make_game_preflight`, `test_progress_dashboard` (repository URL) | #2550 | | `test_docs_repo_paths` | #2552 (all 14 paths; it conflicts with `main`, a merge is on `Tauwni:fix/2552-merge-main`, [correction](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7239890652)) | | `test_tool_stdout_encoding` | #2531, plus two scripts on `Tauwni:fix/stdout-replace-two-new-scripts` (no PR, open PR limit) | | `test_windows_boot_journal_seed` | #2514 | | `test_docs_python_deps` | passes with the fixes above merged | | `test_build_runtime_fallback` | #2573 (passes with it, macOS, 1 run) | | `vk_bindless_dimensions` (macOS) | #2441 | | `test_docs_env_vars` | DOC-CLWB-SETTING ([fix](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7238921436)) | | `test_make_game_pipelines`, `test_sampler_source_census`, `test_spirv_metal_set0_cli_errors`, `test_spirv_metal_set0_extra`, `tests/semantic/test_valu_cvt_f16_int16_mods.py`, `ps_exp_f32_denorm_rt` (macOS) | branches on `Tauwni/leonida`, no PR ([finding](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7239812627)) | | `cs_imgatomic_ext` (macOS, linux-gpu-tools) | #1518, closed without a comment | | `vk_xdxr_postbuild_readback` (Windows) | already passes on `main`: merge `main` | Not checked by a second agent or human yet.
real-rusher commented 2026-11-26 10:12:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by real-rusher on 2026-11-26T10:12:39Z.


Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU; no macOS here, so the osascript path itself is only covered by the mocked tests). Merges cleanly. With this PR, python -I tests/test_make_game_pick.py: 17 tests OK. The PR's test file against main's make_game.py: 2 failures, so the new tests fail on main and pass with the change. compileall clean.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7189056460 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2185#issuecomment-7189056460). Originally posted by [real-rusher](https://github.com/real-rusher) on 2026-11-26T10:12:39Z. --- Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU; no macOS here, so the osascript path itself is only covered by the mocked tests). Merges cleanly. With this PR, python -I tests/test_make_game_pick.py: 17 tests OK. The PR's test file against main's make_game.py: 2 failures, so the new tests fail on main and pass with the change. compileall clean. AI-assisted: yes (Claude Code)
aslan2142 commented 2026-12-01 12:01:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:01:41Z.

Review: COMMENTED


Draft review against current main: using osascript choose folder with argv-passed prompt/path on macOS in make_game.py:641-686 looks clean and clean-room verified, but CI failed on an older base and the PR is still Draft. Please merge/rebase current main and mark Ready for Review so CI runs green.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130869344 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2185#pullrequestreview-6130869344). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T12:01:41Z. **Review:** COMMENTED --- Draft review against current `main`: using `osascript` `choose folder` with argv-passed prompt/path on macOS in `make_game.py:641-686` looks clean and clean-room verified, but CI failed on an older base and the PR is still Draft. Please merge/rebase current `main` and mark Ready for Review so CI runs green. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 12:25:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:25:53Z.


Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.

(AI-assisted triage.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7311120941 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2185#issuecomment-7311120941). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T12:25:53Z. --- Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review. *(AI-assisted triage.)*
aslan2142 commented 2026-12-01 13:03:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T13:03:52Z.

Review: APPROVED


Now ready for review and MERGEABLE. Clean-room verified: using osascript's choose folder on macOS in make_game.py:641-686 with unit coverage in tests/test_make_game_pick.py is clean and avoids requiring Tkinter on macOS.

Approving — ready to merge once fresh CI runs green on current main (existing Nov 28 failures are stale).

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6131792753 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2185#pullrequestreview-6131792753). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T13:03:52Z. **Review:** APPROVED --- Now ready for review and `MERGEABLE`. Clean-room verified: using `osascript`'s `choose folder` on macOS in `make_game.py:641-686` with unit coverage in `tests/test_make_game_pick.py` is clean and avoids requiring Tkinter on macOS. Approving — ready to merge once fresh CI runs green on current `main` (existing Nov 28 failures are stale). *(AI-assisted review.)*
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2185
No description provided.