Config::execute_command uses Unix PATH separators on Windows
- 主要語言
- Rust
- 星號
- 8
- 分支
- 10
- 平均合併
- 3 天 5 小時
- 30 天內合併 PR
- 17
描述
`Config::execute_command` prepends directories to `PATH` with a hard-coded `:` separator:
- `src/config.rs` builds `format!("{}:", self.cargo_home.join("bin").display())` when `CARGO_HOME` differs from the inherited value.
- The same function later builds `format!("{}:", toolchain_opt.display())` before spawning the selected component.
This is correct on Unix, but Windows uses `;` as the PATH separator. On Windows, those prepended directories become part of one malformed PATH entry instead of separate searchable entries. That can prevent the spawned command from finding the active toolchain `opt/` shims or the intended `CARGO_HOME/bin`.
A small fix would be to build PATH values through `std::env::split_paths` / `std::env::join_paths` instead of formatting the separator by hand.
Duplicate check performed before filing:
- `repo:0xMiden/midenup is:issue is:open PATH Windows separator`
- `repo:0xMiden/midenup is:pr is:open PATH Windows separator`
- `repo:0xMiden/midenup is:open windows path`
- `repo:0xMiden/midenup is:open CARGO_HOME`
- `repo:0xMiden/midenup is:open toolchain opt PATH`
貢獻指南
研究方向
The issue is in src/config.rs, specifically the Config::execute_command function. Look for the lines where format! is used to prepend directories to PATH with a ':' separator. Replace the manual string building with std::env::split_paths and std::env::join_paths to handle the platform-specific separator correctly. Test the fix on a Windows system or using cross-platform Rust tests to ensure PATH is constructed properly.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- rust
- 領域
- cli, tooling
- Issue 類型
- 缺陷
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 冷清
- 描述清晰度
- 描述清楚
- 新手友好度
- 70/100