Repository navigation
fix(bootstrap): install piper-tts as a uv tool pinned to Python 3.13 - #360
Conversation
Homebrew bumped python@3 to 3.15 and removed 3.14, which left the pip-installed piper with a dangling shebang. The pip reinstall then failed because onnxruntime has no 3.15 wheels yet. Install piper-tts with uv tool on a pinned 3.13 instead, so Homebrew Python bumps no longer affect it. This also drops the separate install step that only ran on apt systems. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Te8twFgueonWjBhaqiq4Ea
There was a problem hiding this comment.
Code Review — Round 1
Summary
Switching piper-tts from pip to uv tool install --python 3.13 fixes the Homebrew python@3 bump breakage at its source, and dropping the 2>/dev/null || true means future failures show up as a warning instead of being hidden. update_packages always runs right after install_packages under -p, so it's fine to merge the apt-only install step into it. PATH order in .exports puts ~/.local/bin ahead of Homebrew, so the new piper takes priority over the dangling /opt/homebrew/bin/piper.
Verdict
APPROVE - No blocking findings. Two non-blocking suggestions inline: on a fresh Linux box, the first run skips piper because the new uv binary isn't on PATH yet, and a leftover stale entrypoint could be cleaned up.
Automated review by Claude Code
| echo "Updating pip packages..." | ||
| pip3 install --upgrade piper-tts 2>/dev/null || pip3 install --upgrade --break-system-packages piper-tts 2>/dev/null || true | ||
| if [[ "$INSTALL_AI" == true ]]; then | ||
| if command -v uv >/dev/null 2>&1; then |
There was a problem hiding this comment.
[Suggestion] On a fresh Linux/SteamOS machine, uv may not be visible to this process yet. install_linux_common_packages installs uv with curl … astral.sh/uv/install.sh | sh, which puts it in ~/.local/bin. The installer edits shell rc files but not this process's PATH, and bootstrap.sh never adds ~/.local/bin to PATH itself. On a first ./bootstrap.sh -p, from a shell where ~/.local/bin wasn't on PATH (Ubuntu's ~/.profile only adds it if the dir existed at login), command -v uv fails here and the run prints Skipping piper-tts (uv not installed). The old apt path installed piper on that first run via pip3 --user, so this is a small first-run regression. It fixes itself on the next run.
Cheap fix: after the uv install in install_linux_common_packages, mirror the ~/.cargo/env pattern used for rustup, e.g. [[ -d "$HOME/.local/bin" && ":$PATH:" != *":$HOME/.local/bin:"* ]] && export PATH="$HOME/.local/bin:$PATH". Or have this check fall back to $HOME/.local/bin/uv.
| if [[ "$INSTALL_AI" == true ]]; then | ||
| if command -v uv >/dev/null 2>&1; then | ||
| echo "Installing/updating piper-tts..." | ||
| # --force: take over a `piper` entrypoint left by an earlier pip --user install |
There was a problem hiding this comment.
[Suggestion] --force only takes over entrypoints in uv's own bin dir (~/.local/bin). On the macOS machine that hit this bug, the pip-installed /opt/homebrew/bin/piper, whose shebang points to the removed 3.14 interpreter, is left in place. It's harmless for interactive shells because .exports puts ~/.local/bin first. Anything with a Homebrew-only PATH, such as a LaunchAgent or a non-login hook, would still resolve to the broken one. You could optionally remove it in cleanup_legacy_configs, but only when it's a regular file whose shebang interpreter no longer exists, so a working install is never touched.
On a fresh Linux machine, the uv installer only edits shell rc files, so the update_packages step in the same run couldn't find uv and skipped piper-tts. Addresses review feedback on #360. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Te8twFgueonWjBhaqiq4Ea
Feedback AddressedImplemented
Skipped
|
There was a problem hiding this comment.
Code Review — Round 2
Summary
The round-1 first-run PATH suggestion is fixed: install_linux_common_packages now exports ~/.local/bin to PATH, so update_packages can find a uv that was just installed. The new line is [[ ... ]] && export ..., which is safe under set -euo pipefail: a failed test on the left of && doesn't trigger errexit, and the line isn't the function's last statement, so it can't become the function's return status. Both callers run in the same shell (install_packages → update_packages, no subshell), so the export carries through. I found nothing new.
Previously Addressed (Filtered)
- [Suggestion]
bootstrap.shuv not on PATH on a fresh Linux machine: Implemented - [Suggestion]
bootstrap.shbroken/opt/homebrew/bin/piperleft behind: Skipped (one-time migration)
Verdict
APPROVE - No blocking findings.
Automated review by Claude Code
bootstrap.sh -pfailed at "Updating pip packages". Homebrew movedpython@3to 3.15 and removed 3.14. That left/opt/homebrew/bin/piperpointing at an interpreter that no longer exists, and pip couldn't reinstall it becauseonnxruntimehas no 3.15 wheels yet. The failure was hidden by2>/dev/null || true.uv tool install --upgrade --force --python 3.13. This works the same on every platform, keeps it in its own environment, and Homebrew Python bumps no longer affect it.update_packagesalways runs right afterinstall_packages, and uv is already installed by that point on macOS (Brewfile) and Linux (install_linux_common_packages).Verified locally:
piper --helpruns from~/.local/bin, re-running the command works, andmake checkpasses (67/67).🤖 Generated with Claude Code
https://claude.ai/code/session_01Te8twFgueonWjBhaqiq4Ea