@@ -369,27 +369,22 @@ impl<'w, 'pl> Command<'w, 'pl> {
369
369
capture,
370
370
)
371
371
} else {
372
- let ( mut binary, managed_by_rustwide) = match self . binary {
372
+ let ( binary, managed_by_rustwide) = match self . binary {
373
+ // global paths should never be normalized
373
374
Binary :: Global ( path) => ( path, false ) ,
374
- Binary :: ManagedByRustwide ( path) => (
375
- self . workspace
375
+ Binary :: ManagedByRustwide ( path) => {
376
+ let binary = self . workspace
376
377
. expect ( "calling rustwide bins without a workspace is not supported" )
377
378
. cargo_home ( )
378
379
. join ( "bin" )
379
- . join ( exe_suffix ( path. as_os_str ( ) ) ) ,
380
- true ,
381
- ) ,
380
+ . join ( exe_suffix ( path. as_os_str ( ) ) ) ;
381
+ // `cargo_home()` might a relative path
382
+ ( crate :: utils:: normalize_path ( & binary) , true )
383
+ }
382
384
Binary :: __NonExaustive => panic ! ( "do not create __NonExaustive variants manually" ) ,
383
385
} ;
384
- // This is the relative path to a command,
385
- // so we need to normalize it or it won't be found if we change directories
386
- // NOTE: if components.count() == 1, then this is a command that will be looked up in $PATH,
387
- // so we shouldn't normalize it.
388
- if binary. is_relative ( ) && binary. components ( ) . count ( ) > 1 {
389
- binary = crate :: utils:: normalize_path ( & binary) ;
390
- }
391
- let mut cmd = AsyncCommand :: new ( & binary) ;
392
386
387
+ let mut cmd = AsyncCommand :: new ( & binary) ;
393
388
cmd. args ( & self . args ) ;
394
389
395
390
if managed_by_rustwide {
0 commit comments