File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ ALL_TOOLS = [target for target in TOOLS.values()]
2121 data = ALL_TOOLS if tool_name == "cargo" else [target ],
2222 edition = "2018" ,
2323 rustc_env = {
24- "WRAPPED_TOOL_EXECPATH" : "$(execpath {})" .format (target ),
2524 "WRAPPED_TOOL_NAME" : tool_name ,
25+ "WRAPPED_TOOL_ROOTPATH" : "$(rootpath {})" .format (target ),
2626 "WRAPPED_TOOL_TARGET" : "$(rlocationpath {})" .format (target ),
2727 },
2828 toolchains = ["//rust/toolchain:current_rust_toolchain" ],
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use std::process::{exit, Command};
44
55const WRAPPED_TOOL_NAME : & str = env ! ( "WRAPPED_TOOL_NAME" ) ;
66const WRAPPED_TOOL_TARGET : & str = env ! ( "WRAPPED_TOOL_TARGET" ) ;
7- const WRAPPED_TOOL_EXECPATH : & str = env ! ( "WRAPPED_TOOL_EXECPATH " ) ;
7+ const WRAPPED_TOOL_ROOTPATH : & str = env ! ( "WRAPPED_TOOL_ROOTPATH " ) ;
88
99#[ cfg( not( target_os = "windows" ) ) ]
1010const PATH_SEPARATOR : & str = ":" ;
@@ -20,7 +20,11 @@ fn main() {
2020 }
2121 Ok ( path)
2222 } )
23- . unwrap_or ( PathBuf :: from ( WRAPPED_TOOL_EXECPATH ) ) ;
23+ . unwrap_or_else ( |_| {
24+ std:: env:: current_dir ( )
25+ . expect ( "Failed to get current directory" )
26+ . join ( WRAPPED_TOOL_ROOTPATH )
27+ } ) ;
2428
2529 if !wrapped_tool_path. exists ( ) {
2630 panic ! (
@@ -39,7 +43,7 @@ fn main() {
3943
4044 let working_directory = std:: env:: var_os ( "BUILD_WORKING_DIRECTORY" )
4145 . map ( PathBuf :: from)
42- . unwrap_or_else ( || std:: env:: current_dir ( ) . expect ( "Failed to get working directory" ) ) ;
46+ . unwrap_or_else ( || std:: env:: current_dir ( ) . expect ( "Failed to get build working directory" ) ) ;
4347
4448 let mut command = Command :: new ( wrapped_tool_path) ;
4549 command
You can’t perform that action at this time.
0 commit comments