File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ pub fn run_make(config: &BuildConfig, arg: &Utf8UnixPath) -> BuildStatus {
49
49
} ;
50
50
#[ cfg( windows) ]
51
51
let mut command = {
52
+ use alloc:: borrow:: Cow ;
52
53
use std:: os:: windows:: process:: CommandExt ;
53
54
54
55
let mut command = if config. selected_wsl_distro . is_some ( ) {
@@ -60,13 +61,17 @@ pub fn run_make(config: &BuildConfig, arg: &Utf8UnixPath) -> BuildStatus {
60
61
// Strip distro root prefix \\wsl.localhost\{distro}
61
62
let wsl_path_prefix = format ! ( "\\ \\ wsl.localhost\\ {}" , distro) ;
62
63
let cwd = match cwd. strip_prefix ( wsl_path_prefix) {
63
- Ok ( new_cwd) => Utf8UnixPath :: new ( "/" ) . join ( new_cwd. with_unix_encoding ( ) ) ,
64
- Err ( _) => cwd. with_unix_encoding ( ) ,
64
+ // Convert to absolute Unix path
65
+ Ok ( new_cwd) => Cow :: Owned (
66
+ Utf8UnixPath :: new ( "/" ) . join ( new_cwd. with_unix_encoding ( ) ) . into_string ( ) ,
67
+ ) ,
68
+ // Otherwise, use the Windows path as is
69
+ Err ( _) => Cow :: Borrowed ( cwd. as_str ( ) ) ,
65
70
} ;
66
71
67
72
command
68
73
. arg ( "--cd" )
69
- . arg ( cwd. as_str ( ) )
74
+ . arg ( cwd. as_ref ( ) )
70
75
. arg ( "-d" )
71
76
. arg ( distro)
72
77
. arg ( "--" )
You can’t perform that action at this time.
0 commit comments