Repository navigation
make_game --pick: on macOS, the folder dialog is osascript's choose folder, so it needs no Tkinter (MAKE-GAME-PICK-MACOS) - #2185
Draft
Tauwni wants to merge 4 commits into
Conversation
…older, so it needs no Tkinter Homebrew's Python ships without Tkinter, so --pick on a Mac stopped with "The folder dialog couldn't open (No module named '_tkinter')". osascript is on every Mac; it is the native tool there, as kdialog and zenity are on Linux, with Tk still the fallback. Prompt and folder go in as arguments, so nothing is quoted into the script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Verified on main a73a57e (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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: MAKE-GAME-PICK-MACOS (#1608 (comment))
What and why
make_game.py --pickopens its folder dialog through Tk on macOS. Homebrew's Python ships without Tkinter (it's a separatepython-tk@3.Nformula), so on a Mac with Homebrew's Python--pickstops:osascriptis on every Mac, and itschoose folderis 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 asargv, not pasted into the script, so a path with quotes needs no escaping. Cancel is AppleScript error -128, whichosascriptexits 1 with, the codenative_askalready treats as cancelled.native_warn:display dialog … with icon caution, also with the message passed asargv.osascriptfails to run, it falls back to Tk as before.Tested
Apple M3, macOS 26.5.1:
osacompile. The warning dialog showed a message with quotes, a backslash and a newline, passed asargv(run withgiving up after 1). Thechoose folderdialog 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. Alltests/test_make_game*.pyare OK.AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly.🤖 Generated with Claude Code
Red checks: from
main, not this changeThe failing jobs (
check,macos-python,stdlib-tests-linux,linux-gpu-tools,macos,windows) fail the same way onmaind48a957bb(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:maintest_docs_cli_flagstest_make_game_preflight,test_progress_dashboard(repository URL)test_docs_repo_pathsmain, a merge is onTauwni:fix/2552-merge-main, correction)test_tool_stdout_encodingTauwni:fix/stdout-replace-two-new-scripts(no PR, open PR limit)test_windows_boot_journal_seedtest_docs_python_depstest_build_runtime_fallbackvk_bindless_dimensions(macOS)test_docs_env_varstest_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)Tauwni/leonida, no PR (finding)cs_imgatomic_ext(macOS, linux-gpu-tools)vk_xdxr_postbuild_readback(Windows)main: mergemainNot checked by a second agent or human yet.