Skip to content

Fix Windows installer cargo stderr handling#6

Merged
cleak merged 1 commit into
masterfrom
codex/fix-install-ps1-stderr
Apr 7, 2026
Merged

Fix Windows installer cargo stderr handling#6
cleak merged 1 commit into
masterfrom
codex/fix-install-ps1-stderr

Conversation

@cleak
Copy link
Copy Markdown
Owner

@cleak cleak commented Apr 7, 2026

Summary

  • run cargo install through Start-Process so Windows PowerShell 5.1 does not convert Cargo's normal stderr progress output into a terminating NativeCommandError
  • preserve argument handling for spaced paths with an explicit Windows argument quoting helper
  • document the PowerShell-specific behavior inline for future maintainers

Verification

  • ./install.ps1
  • ./install.ps1 -NoPathUpdate
  • PowerShell parser check: Parse OK
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows command-line argument handling and escaping in the installation process to prevent errors with special characters or whitespace.
    • Enhanced error detection and reporting in the installation script for more reliable and accurate installation execution.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 87416fbd-083c-4c19-946e-381ab02745ff

📥 Commits

Reviewing files that changed from the base of the PR and between 62eedc8 and d7070b7.

📒 Files selected for processing (1)
  • install.ps1

📝 Walkthrough

Walkthrough

The PR modifies install.ps1 to improve Windows command-line argument handling when invoking Cargo. It introduces a helper function ConvertTo-WindowsArgument to properly escape and quote arguments, replaces direct call expression with Start-Process, and updates exit code capture from $LASTEXITCODE to $process.ExitCode.

Changes

Cohort / File(s) Summary
PowerShell Installation Script
install.ps1
Added ConvertTo-WindowsArgument helper function to handle proper Windows argument escaping. Refactored Invoke-CargoInstall to use Start-Process with -ArgumentList instead of direct call expressions. Updated exit code handling to read from $process.ExitCode instead of $LASTEXITCODE. Improved stderr/stdout redirection behavior under strict error handling contexts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Behold! Our PowerShell path now shines so bright,
With arguments properly escaped, left and right,
Start-Process dances where invocation once stood,
Windows command-lines now handled as they should! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix Windows installer cargo stderr handling' directly and specifically describes the main change: addressing stderr handling in the Windows installer for cargo, which is the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-install-ps1-stderr

Comment @coderabbitai help to get the list of available commands and usage tips.

@cleak cleak merged commit 0e428f8 into master Apr 7, 2026
1 check passed
@cleak cleak deleted the codex/fix-install-ps1-stderr branch April 7, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant