Repository navigation
fix(setup): install and check compatible Go version for TinyGo - #89
Conversation
TinyGo requires Go ≤ 1.25. Without this, the logger WASM/CGo build fails with a "requires go version 1.19 through 1.25" error. - Install [email protected] instead of latest go when go is missing - Link [email protected] after install (keg-only formulae are not auto-linked, so without this `go` would still not be in PATH post-install) - After all deps are installed, check the active Go version and warn with actionable instructions if it is > 1.25 - Guard the version comparison against empty strings to prevent set -eu from aborting the script if `go version` produces no output Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe setup script maps Homebrew's Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/setup.sh (1)
191-198: Silent failure when linking fails could confuse users.If
brew link [email protected] --forcefails (e.g., due to conflicts with an existing Go installation), the error is suppressed and no feedback is given. Users may not realize thatgostill points to an incompatible version.Consider providing feedback on link failure so users know to manually resolve conflicts.
🔧 Proposed fix to handle link failure
# [email protected] is keg-only (not linked by default) — link it so `go` is in PATH for formula in "${to_install[@]}"; do if [ "$formula" = "[email protected]" ]; then - brew link [email protected] --force 2>/dev/null && success "[email protected] linked as the active Go version." + if brew link [email protected] --force 2>/dev/null; then + success "[email protected] linked as the active Go version." + else + warn "Could not link [email protected] — you may need to unlink another Go version first (brew unlink go)." + fi break fi done🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/setup.sh` around lines 191 - 198, The linking step in the for loop that runs `brew link [email protected] --force` currently swallows errors (2>/dev/null) and only prints success on success; update the block around the `brew link` invocation to check its exit status and on failure call the existing `error` (or `fail`) helper and print a clear message instructing the user to resolve conflicts or unlink other Go versions (e.g., run `brew unlink` or inspect `brew doctor`), referencing the for loop and the `brew link [email protected] --force` command and the `success` helper so you add a failure branch that reports the error instead of remaining silent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@scripts/setup.sh`:
- Around line 191-198: The linking step in the for loop that runs `brew link
[email protected] --force` currently swallows errors (2>/dev/null) and only prints success
on success; update the block around the `brew link` invocation to check its exit
status and on failure call the existing `error` (or `fail`) helper and print a
clear message instructing the user to resolve conflicts or unlink other Go
versions (e.g., run `brew unlink` or inspect `brew doctor`), referencing the for
loop and the `brew link [email protected] --force` command and the `success` helper so you
add a failure branch that reports the error instead of remaining silent.
Summary
TinyGo (used to build the logger WASM/CGo targets) requires Go ≤ 1.25. Without this, a fresh setup on a machine with Go 1.26+ fails with:
go(resolves to latest, currently 1.26) to[email protected][email protected]is a keg-only formula so Homebrew does not auto-link it; without thebrew linkstep,gowould still not be inPATHafter installation and the build would fail immediately aftergoversion and warns with actionable instructions if > 1.25 (covers the case where go was already installed at an incompatible version)set -euat the top of the script, an emptyGO_MAJOR/GO_MINORfrom a brokengoshim would abort the script mid-run; now guarded with a non-empty check before the comparisonTest plan
pnpm setup, select go — [email protected] installs and links, build succeedspnpm setup— warning appears suggesting downgrade or misepnpm setup— no warning, build succeeds🤖 Generated with Claude Code
Summary by CodeRabbit