fix(launcher): warn about macOS Xcode CLT prompt instead of forcing managed Python#324
Open
lstein wants to merge 1 commit into
Open
fix(launcher): warn about macOS Xcode CLT prompt instead of forcing managed Python#324lstein wants to merge 1 commit into
lstein wants to merge 1 commit into
Conversation
…d of forcing managed Python PR #322 tried to suppress the macOS "install Xcode Command Line Tools" dialog by forcing uv to use a managed CPython (UV_PYTHON_PREFERENCE= only-managed), on the theory that the framework Python's non-relocatable binary was what made uv run install_name_tool. Testing on a cold Mac disproved that: uv runs install_name_tool while building the tool venv regardless of which interpreter it uses, so the dialog fires immediately either way. The tools aren't actually needed — the install completes fine whether the user accepts or cancels — and there's no clean way to stop the prompt. So revert the only-managed approach and instead set the right expectation: before uv runs on macOS, if `xcode-select -p` shows the Command Line Tools are absent, print a short warning that the dialog will appear and is safe to dismiss, pause ~5s so it's read, then proceed. - launcher/uv.go: drop UV_PYTHON_PREFERENCE=only-managed; add warnIfXcodeToolsMissing() and call it at the top of install(). - launcher/uv_test.go: TestUVEnvForcesManagedPython -> TestUVEnvRedirectsState (the dir-redirect coverage stays; the only-managed assertion is gone). - docs/README: revert the `--python 3.12 --python-preference only-managed` recipe back to `uv tool install photomapai --torch-backend auto` and drop the now-false note that it avoids the macOS prompt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Background
PR #322 (already merged) tried to suppress the macOS "install Xcode Command Line Tools" dialog during first-run setup by forcing uv to use a managed CPython (
UV_PYTHON_PREFERENCE=only-managed). The theory: the python.org framework Python is non-relocatable, so uv runsinstall_name_tool(an Xcode CLT) when copying it into the tool venv, triggering the prompt.Testing on a cold Mac disproved that. uv runs
install_name_toolwhile building the tool virtualenv regardless of which interpreter it uses, so the dialog fires immediately either way. The managed-Python approach doesn't help, and there's no clean way to suppress the prompt.Crucially, the Command Line Tools aren't actually needed — PhotoMapAI installs fine whether the user accepts or cancels the dialog.
This change
Revert the
only-managedapproach and instead set the right expectation: before uv runs on macOS, ifxcode-select -preports the Command Line Tools are absent, print a short warning that the (harmless) dialog will appear, pause ~5s so it's read, then proceed.The printed message:
Contents
launcher/uv.go— dropUV_PYTHON_PREFERENCE=only-managedfromuvEnv(); addwarnIfXcodeToolsMissing()(no-op off macOS / when CLT already present) and call it at the top ofinstall(), right before the first uv invocation.launcher/uv_test.go—TestUVEnvForcesManagedPython→TestUVEnvRedirectsState; keeps the dir-redirect coverage, drops the only-managed assertion.uv tool install photomapai --python 3.12 --python-preference only-managed --torch-backend autorecipe back touv tool install photomapai --torch-backend auto, and remove the now-false note that those flags avoid the macOS prompt.Notes
masterbut is part of the not-yet-released 1.1.0). No released version regresses.install_name_tool… er, junction (error 448) investigation — that's a separate managed-Python-on-Windows issue still pending hardware testing.Tests
go build/go vet/go test/gofmt -lall clean.🤖 Generated with Claude Code