fix(install): detect busybox tar so zstd tarballs are not mis-extracted#10385
Conversation
The mise.run install script's tar_supports_zstd() concluded that busybox tar can decompress .tar.zst, because busybox reports a "1.37.x" version that matches the GNU tar >= 1.31 check. On Alpine 3.22 this made the script download the .tar.zst tarball and run plain `tar -xf` on it, which fails with "tar: invalid tar magic". Detect busybox before the GNU version check and treat it as not supporting zstd, so installation falls back to the zstd pipe (zstd -d -c | tar -xf -) or a .tar.gz download -- both of which busybox handles. Addresses discussion jdx#10074. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds BusyBox tar detection to the installer script. When BusyBox tar is detected via version output inspection, ChangesBusyBox tar compatibility
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Greptile SummaryFixes a false-positive in
Confidence Score: 5/5The change is a single, targeted insertion with no side effects on non-busybox platforms — safe to merge. The new elif branch is narrowly scoped: No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix(install): detect busybox tar so zstd..." | Re-trigger Greptile |
Problem
On Alpine 3.22,
curl https://mise.run | shfails to install with:Reported in #10074.
Root cause
The install script (
packaging/standalone/install.envsubst) decides whether to download the.tar.zstor.tar.gzbuild viatar_supports_zstd(), which checks thetarversion:Alpine''s busybox
tarreports version 1.37.0, which matches this GNU-tar>= 1.31regex. So the script concludes busybox tar can transparently decompress zstd, downloads the.tar.zsttarball, and then runs plaintar -xfon it — but busybox tar cannot decompress zstd, henceinvalid tar magic.Fix
Detect busybox before the GNU version check and treat it as not supporting zstd:
With that,
tar_supports_zstd()returns false on busybox, so:.tar.gzbuild, which busybox extracts fine; and.tar.zstis forced (e.g.MISE_INSTALL_EXT=tar.zst), extraction falls back to the existing zstd-pipe pathzstd -d -c "$cache_file" | tar -xf -(the script already requires thezstdbinary), which feeds busybox a plain tar on stdin.GNU tar and bsdtar never print
busyboxin--version, so no other platform is affected.2>&1+-imake the check robust to busybox printing itsBusyBox v1.37.0banner on stderr / with mixed case.Testing
shellcheck packaging/standalone/install.envsubst✅ (this is whatscripts/test-standalone.shruns against the rendered script)Addresses #10074
🤖 Generated with Claude Code
Summary by CodeRabbit