fix: abort with a clear message on Intel macOS for pnpm v11+#46
fix: abort with a clear message on Intel macOS for pnpm v11+#46
Conversation
pnpm v11+ no longer publishes pnpm-darwin-x64.tar.gz because the SEA binary Node.js produces for darwin-x64 segfaults at startup (upstream nodejs/node#62893; pnpm/pnpm#11423; the Node.js team has decided not to fix it as Intel macOS is being phased out). Without a guard, the script 404s on the missing tarball and surfaces as a generic "Install Error!" with no explanation. Detect platform=darwin + arch=x64 + major>=11 right after version resolution and abort early with the upstream issue link plus three working alternatives (npm / Homebrew / Corepack). Linux, Apple Silicon Mac, Windows, and v10 darwin-x64 (still pkg-built and working) are unaffected.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for getpnpm ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds stricter pnpm major-version parsing and an early abort in download_and_install() to prevent installing pnpm v11+ on macOS Intel (darwin/x64), and updates SHASUMS256.txt with the new install.sh checksum. ChangesmacOS Intel Installation Guard
Sequence Diagram(s)(No sequence diagram applicable.) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
🚥 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 unit tests (beta)
Comment |
…self-explains Once pnpm/get.pnpm.io#46 lands, install.sh aborts on darwin-x64 with a clear pointer to the upstream Node.js issue and three working alternatives. The page no longer needs to repeat the same context — a one-line "not supported, use npm/Corepack/Homebrew, see #11423" is enough. Keeps the link to #11423 for users who want the full story.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@install.sh`:
- Around line 157-159: The script fails to handle PNPM_VERSION values with a
leading "v" (e.g. "v11.0.0") before numeric comparison; normalize PNPM_VERSION
into a cleaned variable (strip any leading "v" or non-digit prefixes) before
computing major_version and before the download decision so cut -d. -f1 yields a
numeric major; update the places that set major_version and the download
selection to use the sanitized version variable (e.g., sanitized_version or
normalized_version derived from PNPM_VERSION) so the numeric comparison and
branching work reliably on Intel macOS and elsewhere.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
CodeRabbit flagged that `cut -d. -f1` on a v-prefixed version (e.g. PNPM_VERSION=v11.0.0) returns "v11", which fails the numeric `-ge 11` test silently because of `2>/dev/null` and skips the Intel-macOS guard. The same bug was on the pre-existing major_version line further down, which selects the v11+ tarball vs legacy single-binary download path. Compute major_version once near the top with `sed -E 's/^v//; s/^([0-9]+).*/\1/'`, abort early if normalization yields nothing, and reuse the value throughout. Drops the now-unnecessary `2>/dev/null` suppression on the remaining test (major_version is guaranteed numeric or we already aborted) and removes the duplicate computation. Verified: 11.0.4, v11.0.4, 11.0.0-rc.1, v11, 10.33.2, v10.33.2 all normalize to the correct major; v11.0.4 with darwin-x64 correctly triggers the abort.
Summary
pnpm-darwin-x64.tar.gzis no longer published from pnpm v11 onward (pnpm/pnpm#11455) because the SEA binary Node.js produces fordarwin-x64segfaults at startup — upstream nodejs/node#62893, which the Node.js team has opted not to fix on the grounds that x64 macOS is being phased out.Without a guard,
install.shon an Intel Mac asking for v11 will:pnpm-darwin-x64.tar.gzfrom the v11 release.Install Error!and no explanation.Change
Add an early abort right after platform/arch/version resolution: if
platform=darwin && arch=x64 && major>=11, abort with a clear message and three working alternatives (npm / Homebrew / Corepack), plus a link to pnpm/pnpm#11423 for context.Compat
The guard is gated on all three of:
platform=darwin,arch=x64,major>=11. Verified locally:@pnpm/exeis still pkg-built and works on Intel Mac).install.ps1is Windows-only so it doesn't need a corresponding change.Test plan
sh -n install.shandbash -n install.shparse cleanly.Related
darwin-x64artifact from@pnpm/exeand the GitHub release.Summary by CodeRabbit
Bug Fixes
Chores