Repository navigation
Conversation
… PATH Resolves (#2474) ## Summary `host-setup/bootstrap.ps1` ran `& tar` and checked `Get-Command tar`, so the tar it reached depended on the `PATH` of the shell that launched it. A pwsh started from Git Bash finds MSYS `/usr/bin/tar` first, which reads the `C:` prefix of the archive path as a remote host, and the extraction fails. - `Get-TarPath` names `%SystemRoot%\System32\tar.exe`, and both the extraction and the prerequisite check now use it. - `test_bootstrap_ps1_names_the_system32_tar` pins the System32 path and refuses `tar` in command position in any non-comment line: bare, `&`-invoked, quoted, `.exe`-suffixed, or under `Get-Command [-Name]`. Part of #2471, which the promotion pull request closes. ## Verification Native, on Windows 11, launched from Git Bash with `/usr/bin/tar` first on `PATH`, `pwsh -NoProfile -File host-setup/bootstrap.ps1 -Report -Dir <scratch dir>`: - **Before** (`develop` at c9b2c66): `tar (child): Cannot connect to C: resolve failed`, then `ERROR: Could not extract the downloaded archive`, exit 1. - **After** (this branch): the tree extracted and the report ran to `==> Done`, exit 0. `-Report` drives the same `Get-Tree` extraction that `-Skills` does, without rewriting this host's installed Skills. - `test_bootstrap_ps1_names_the_system32_tar` passes, and it fails against a copy with the bare `tar -xzf` restored. - PSScriptAnalyzer on `bootstrap.ps1` reports 0 findings. ruff check and format are clean. - `local-strict-review`: round 1 raised one finding, that the test regex missed a bare `tar` statement, fixed in bc052f8. Round 2 found nothing. - Six `TestSpecCoverage.test_linux_installer_*` tests error with `WinError 193` on Windows, the same on clean `develop`. They are filed as #2473. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- 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 |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Extend the regression guard to reject path-qualified tar executables.
Review effort: Lite
Findings: None
What changed in this PR
Updates Windows bootstrap extraction to use %SystemRoot%\System32\tar.exe instead of PATH-resolved tar.
Changes:
- Uses the explicit System32 executable for extraction and prerequisite checks.
- Adds regression coverage against PATH-based tar invocation.
| File | Summary |
|---|---|
tests/test_bootstrap.py |
Adds tar resolution safeguards; path-qualified executables remain uncovered. |
host-setup/bootstrap.ps1 |
Uses the explicit System32 tar executable. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2475 +/- ##
=======================================
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:
|
|
Copilot overview note ("Extend the regression guard to reject path-qualified tar executables"): real. A path to Git's own |
## Summary Answers the Copilot overview note on promotion [#2475](#2475), "Extend the regression guard to reject path-qualified tar executables". A path to Git's own `tar.exe` reaches the same MSYS tar without going through `PATH`. `test_bootstrap_ps1_names_the_system32_tar` used to enumerate the forms that resolve tar through `PATH`, and each review round found another. It is now an allow-list. Outside a `.tar.gz` archive name, the only non-comment lines in `bootstrap.ps1` that may name tar are the exact `Get-TarPath` definition and its whole-line `die '...'` message. Any other line naming tar fails, whatever form its invocation takes. Part of #2471. ## Verification - A mutation probe replaced the extraction line with each of these, and the test failed for every one: - a bare `tar` - `& tar` - `& "$env:ProgramFiles\Git\usr\bin\tar.exe"` - `& /usr/bin/tar` - a reordered `Get-Command -ErrorAction SilentlyContinue tar` - `$t = 'tar'; & $t` - `Start-Process -FilePath tar.exe` - `die 'x'; tar ...` - The unchanged file passes. - A line check cannot reach a computed name such as `('t' + 'ar')`, and the docstring says so by scoping its claim to lines that name tar. - ruff check and format are clean. - `local-strict-review`: round 1 raised one finding, a docstring that overclaimed, fixed in 9c83788. Round 2 found nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
|
Copilot overview on e96cb58 ("Only a non-blocking documentation nit remains", 0 open findings): no nit is named in the overview or in any thread, so there is nothing specific to act on. The earlier note on f9a6573 ("Extend the regression guard to reject path-qualified tar executables") was fixed by #2476, merged into develop as e96cb58, which replaces the deny-list with an allow-list. The comments on #2476 record its probe evidence. |
Summary
Promotes #2474 to
main.host-setup/bootstrap.ps1extracted its archive with whatevertarPATHresolved. A pwsh launched from Git Bash finds MSYS/usr/bin/tarfirst, which reads theC:prefix of the archive path as a remote host, so-Skills,-Report, and every other mode that fetches a tree failed withCannot connect to C: resolve failed. The loader now names%SystemRoot%\System32\tar.exeat both the extraction and the prerequisite check. A test refusestarin command position anywhere in the file, including bare,&-invoked, quoted, and assigned forms, and underGet-Command,gcm,Start-Processor their aliases in any option order.A native Windows 11 run, launched from Git Bash with
/usr/bin/tarfirst onPATH, failed ondevelopbefore the change and extracted and ran to completion after it.Closes #2471
🤖 Generated with Claude Code