From 867b0efdf2d116281a7c0830f3cf1efbcf0545fb Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 10 May 2022 17:37:41 +0800 Subject: [PATCH] hosted mode breaks under windows due to missing .exe on some configs I don't know why it doesn't break under a default config, but if xous-core is cloned to a directory that doesn't match the repo name this breaks. This patch tries to fix it for that case. --- xtask/src/main.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 758a09c7d..86519a171 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -981,13 +981,19 @@ fn run( let mut paths = vec![]; for i in init { - let tmp: PathBuf = Path::new(&format!( - "..{}target{}{}{}{}", - MAIN_SEPARATOR, MAIN_SEPARATOR, stream, MAIN_SEPARATOR, i - )) - .to_owned(); - // .canonicalize() - // .or(Err(BuildError::PathConversionError))?; + let tmp: PathBuf = if cfg!(windows) { + Path::new(&format!( + "..{}target{}{}{}{}.exe", + MAIN_SEPARATOR, MAIN_SEPARATOR, stream, MAIN_SEPARATOR, i + )) + .to_owned() + } else { + Path::new(&format!( + "..{}target{}{}{}{}", + MAIN_SEPARATOR, MAIN_SEPARATOR, stream, MAIN_SEPARATOR, i + )) + .to_owned() + }; paths.push(tmp); } for t in &paths {