Skip to content

fix(launcher): warn about macOS Xcode CLT prompt instead of forcing managed Python#324

Open
lstein wants to merge 1 commit into
masterfrom
lstein/fix/macos-xcode-clt-warning
Open

fix(launcher): warn about macOS Xcode CLT prompt instead of forcing managed Python#324
lstein wants to merge 1 commit into
masterfrom
lstein/fix/macos-xcode-clt-warning

Conversation

@lstein

@lstein lstein commented Jun 9, 2026

Copy link
Copy Markdown
Owner

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 runs install_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_tool while 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-managed approach and instead set the right expectation: before uv runs on macOS, if xcode-select -p reports 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:

MacOS will ask you to install the XCode Command Line Tools. Either cancel or accept this request -- it makes no difference.

Contents

  • launcher/uv.go — drop UV_PYTHON_PREFERENCE=only-managed from uvEnv(); add warnIfXcodeToolsMissing() (no-op off macOS / when CLT already present) and call it at the top of install(), right before the first uv invocation.
  • launcher/uv_test.goTestUVEnvForcesManagedPythonTestUVEnvRedirectsState; keeps the dir-redirect coverage, drops the only-managed assertion.
  • docs / READMEs — revert the uv tool install photomapai --python 3.12 --python-preference only-managed --torch-backend auto recipe back to uv tool install photomapai --torch-backend auto, and remove the now-false note that those flags avoid the macOS prompt.

Notes

  • This effectively reverts the user-facing behavior of fix(launcher): force uv to use managed Python (avoids macOS Xcode prompt) #322 (which shipped on master but is part of the not-yet-released 1.1.0). No released version regresses.
  • Unrelated to the open Windows/OneDrive 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 -l all clean.

🤖 Generated with Claude Code

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant