fix(bootstrap): always try only-system fallback (drop too-strict gate, refs #130) - #142
Conversation
…gate Verification of #140 (driving real uv) found system_python_ge_311() was stricter than uv's own interpreter discovery: it probed only `python3`/`python`, so on a machine where `python3` is the macOS 3.9 but a Homebrew 3.14 exists, the gate returned false and the only-system fallback was skipped — even though `UV_PYTHON_PREFERENCE=only-system uv venv` resolves 3.14 fine. Fix: drop the pre-gate (and the now-unused parse_py_version/system_python_ge_311 helpers + the parse test) and always add the system-python attempt as the last resort. uv's discovery is the authority; with `requires-python = ">=3.11"` it resolves any compatible system interpreter or fails fast → remediation. Verified live: `only-system uv venv` created a venv from system CPython 3.14.5 on this host (no 3.11.x present). cargo test + cargo check clean. Refs #130. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe PR simplifies venv bootstrap by removing pre-flight Python version checking and unconditionally adding a system-python fallback strategy that uses ChangesBootstrap System Python Fallback Simplification
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Filename | Overview |
|---|---|
| frontend/src-tauri/src/bootstrap.rs | Removes system_python_ge_311 pre-gate and parse_py_version helpers; always appends the UV_PYTHON_PREFERENCE=only-system venv attempt as a final fallback. One stale comment still references the old '(only if >= 3.11)' condition. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ensure_venv_ready] --> B[resolve_uv]
B --> C{uv available?}
C -- No --> Z[fail → remediation]
C -- Yes --> D[Attempt 1: uv venv --python 3.11 --managed-python\ndefault GitHub host]
D -- success --> OK[venv_ok = true → proceed to uv sync]
D -- fail --> E[Attempt 2: uv venv --python 3.11 --managed-python\nUV_PYTHON_INSTALL_MIRROR=gh-proxy]
E -- success --> OK
E -- fail --> F[Attempt 3: uv venv\nUV_PYTHON_PREFERENCE=only-system\nalways added — no pre-gate]
F -- success --> OK
F -- fail --> Z
OK --> G[uv sync --frozen --no-dev]
G -- success --> H[Return venv_python path]
G -- fail --> Z
Comments Outside Diff (1)
-
frontend/src-tauri/src/bootstrap.rs, line 451-454 (link)The parenthetical
(only if >= 3.11)is a leftover from the removedsystem_python_ge_311gate and now describes behavior that no longer exists — the fallback is always added unconditionally.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Reviews (1): Last reviewed commit: "fix(bootstrap): always try only-system f..." | Re-trigger Greptile
Bring the branch up to date with main and resolve 5 conflicts as feature-unions so nothing shipped since #133 was opened regresses: - useTTS.js: take main's #141 validator-safe instruct (buildDesignInstruct); #133 held only the stale pre-#141 dedup logic. - dub_pipeline.py: UNION — keep #133's download-task cancel cleanup AND main's plan-04 logging + structured failure event (build_failure). - dubSlice.ts / useDubWorkflow.js: UNION — keep both #133's dub download-progress state (setDubPrepProgress / setDubCurrentSegId) and main's pipeline-error-transparency state (setDubFailure). - bootstrap.rs: take main's shipped plan-03 network-resilience cascade (#140/#142); #133's region-based mirror approach was the superseded alternative for the same concern. get_effective_region stays live (shared via config.rs, used by tools.rs). Verified: frontend typecheck + build clean; 90 backend tests pass (dub / failure / timing / onboarding / personalities), 0 failures. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up from verifying #140 by driving the real
uvbinary.Finding:
system_python_ge_311()was stricter than uv's own interpreter discovery — it probed onlypython3/python. On this Mac,python3is the system 3.9.6 (nopython), so the gate returned false and theonly-systemfallback was skipped — even thoughUV_PYTHON_PREFERENCE=only-system uv venvimmediately resolves the Homebrew CPython 3.14.5. So in the exact worst case the fallback exists for (GitHub and mirror blocked), a user with a perfectly good system Python could be sent to the remediation screen.Fix: drop the pre-gate (and the now-unused
parse_py_version/system_python_ge_311helpers + the parse test); always add the system-python attempt as the last cascade step. uv's discovery is the authority — withrequires-python = ">=3.11"it resolves any compatible system interpreter (3.12/3.13/3.14…) or fails fast → remediation.Verified live (real uv 0.11.14):
only-system uv venvbuilt a venv from system CPython 3.14.5 on a host with no 3.11.x.cargo test+cargo checkclean.Refs #130.
🤖 Generated with Claude Code
Summary by CodeRabbit