-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Closed
Copy link
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContribution especially encouragedContribution especially encouraged
Description
Summary
Running (for example) uvx awslabs.cdk-mcp-server@latest on Windows will produce the error
error: Failed to spawn: `awslabs.cdk-mcp-server`
Caused by: program not found
This can be worked around by running uvx --from awslabs.cdk-mcp-server@latest awslabs.cdk-mcp-server.exe, indicating that uv is not correctly finding the Windows executable.
I believe this is due to the extension guessing implementation found in
uv/crates/uv-shell/src/runnable.rs
Lines 73 to 100 in 57df014
| pub fn from_script_path(script_path: &Path, runnable_name: &OsStr) -> Command { | |
| let script_path = script_path.join(runnable_name); | |
| // Honor explicit extension if provided and recognized. | |
| if let Some(script_type) = script_path | |
| .extension() | |
| .and_then(OsStr::to_str) | |
| .and_then(Self::from_extension) | |
| .filter(|_| script_path.is_file()) | |
| { | |
| return script_type.as_command(&script_path); | |
| } | |
| // Guess the extension when an explicit one is not provided. | |
| // We also add the extension when missing since for some types (e.g. PowerShell) it must be explicit. | |
| Self::all() | |
| .iter() | |
| .map(|script_type| { | |
| ( | |
| script_type, | |
| script_path.with_extension(script_type.to_extension()), | |
| ) | |
| }) | |
| .find(|(_, script_path)| script_path.is_file()) | |
| .map(|(script_type, script_path)| script_type.as_command(&script_path)) | |
| .unwrap_or_else(|| Command::new(runnable_name)) | |
| } | |
| } |
since
script_path.with_extension(script_type.to_extension())
will replace the "extension" found after the "." of the original script name, so instead of searching for awslabs.cdk-mcp-server.exe it will search for awslabs.exe (see the examples for with_extension).
Platform
Windows 11 x86_64
Version
uv 0.8.0 (0b23572 2025-07-17)
Python version
Python 3.12.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContribution especially encouragedContribution especially encouraged