Repository navigation
Invoke the System32 tar.exe in bootstrap.ps1 Rather Than Whatever tar PATH Resolves - #2474
Conversation
… PATH Resolves A pwsh launched from Git Bash finds MSYS tar first on PATH, and that tar reads the drive prefix of the Windows archive path as a remote host, so extraction failed. The loader now names %SystemRoot%\System32\tar.exe at both the extraction and the prerequisite check, and a test pins that no bare tar remains. Closes #2471 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2474 +/- ##
========================================
Coverage 58.47% 58.47%
========================================
Files 16 16
Lines 8062 8062
========================================
Hits 4714 4714
Misses 3348 3348
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Extend the regression guard to cover all valid Get-Command option orders.
Review effort: Lite
Findings: None
What changed in this PR
Updates Windows bootstrap extraction to use System32 tar.exe instead of PATH-resolved tar.
Changes:
- Adds a shared System32 tar path helper.
- Uses it for extraction and prerequisite checks.
- Adds regression coverage for PATH-based tar resolution.
| File | Description |
|---|---|
tests/test_bootstrap.py |
Verifies tar is not resolved through PATH. |
host-setup/bootstrap.ps1 |
Uses the explicit System32 tar path. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Copilot overview note ("Extend the regression guard to cover all valid Get-Command option orders"): real, fixed in da4f6a2, then widened in 023259b. The fix covers the class rather than the instance. Any non-comment line in which |
… Rather Than Whatever tar PATH Resolves (#2475) ## Summary Promotes [#2474](#2474) to `main`. `host-setup/bootstrap.ps1` extracted its archive with whatever `tar` `PATH` resolved. A pwsh launched from Git Bash finds MSYS `/usr/bin/tar` first, which reads the `C:` prefix of the archive path as a remote host, so `-Skills`, `-Report`, and every other mode that fetches a tree failed with `Cannot connect to C: resolve failed`. The loader now names `%SystemRoot%\System32\tar.exe` at both the extraction and the prerequisite check. A test refuses `tar` in command position anywhere in the file, including bare, `&`-invoked, quoted, and assigned forms, and under `Get-Command`, `gcm`, `Start-Process` or their aliases in any option order. A native Windows 11 run, launched from Git Bash with `/usr/bin/tar` first on `PATH`, failed on `develop` before the change and extracted and ran to completion after it. Closes #2471 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
host-setup/bootstrap.ps1ran& tarand checkedGet-Command tar, so the tar it reached depended on thePATHof the shell that launched it. A pwsh started from Git Bash finds MSYS/usr/bin/tarfirst, which reads theC:prefix of the archive path as a remote host, and the extraction fails.Get-TarPathnames%SystemRoot%\System32\tar.exe, and both the extraction and the prerequisite check now use it.test_bootstrap_ps1_names_the_system32_tarpins the System32 path and refusestarin command position in any non-comment line: bare,&-invoked, quoted,.exe-suffixed, or underGet-Command [-Name].Part of #2471, which the promotion pull request closes.
Verification
Native, on Windows 11, launched from Git Bash with
/usr/bin/tarfirst onPATH,pwsh -NoProfile -File host-setup/bootstrap.ps1 -Report -Dir <scratch dir>:developat c9b2c66):tar (child): Cannot connect to C: resolve failed, thenERROR: Could not extract the downloaded archive, exit 1.==> Done, exit 0.-Reportdrives the sameGet-Treeextraction that-Skillsdoes, without rewriting this host's installed Skills.test_bootstrap_ps1_names_the_system32_tarpasses, and it fails against a copy with the baretar -xzfrestored.bootstrap.ps1reports 0 findings. ruff check and format are clean.local-strict-review: round 1 raised one finding, that the test regex missed a baretarstatement, fixed in bc052f8. Round 2 found nothing.TestSpecCoverage.test_linux_installer_*tests error withWinError 193on Windows, the same on cleandevelop. They are filed as Skip the Linux Installer Tests in test_bootstrap Where install-tools.sh Cannot Execute #2473.🤖 Generated with Claude Code