From 61df17bcda2ce9529284c5ea1a945aeb8a59c38a Mon Sep 17 00:00:00 2001 From: korejan <64199710+korejan@users.noreply.github.com> Date: Wed, 3 Aug 2022 14:10:00 +0100 Subject: [PATCH] Fixes xtask build script for UWP/hololens2 builds. Fixes xtask build script for UWP/hololens2 builds, caused by changes in rustup 1.25 https://github.com/rust-lang/rustup/issues/3036 --- .../alxr-client/uwp/cargo_build_uwp.bat | 4 +++- alvr/xtask/src/main.rs | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/alvr/openxr-client/alxr-client/uwp/cargo_build_uwp.bat b/alvr/openxr-client/alxr-client/uwp/cargo_build_uwp.bat index 722075e189..280fa0d600 100644 --- a/alvr/openxr-client/alxr-client/uwp/cargo_build_uwp.bat +++ b/alvr/openxr-client/alxr-client/uwp/cargo_build_uwp.bat @@ -22,5 +22,7 @@ if exist !VCVarsAllBat! ( set PATH=!CMakePath!;!PATH! ) cmake --version - cargo +nightly build -Z build-std=std,panic_abort --target !cargoArch!-uwp-windows-msvc %~2 + @REM cargo +nightly build -Z build-std=std,panic_abort --target !cargoArch!-uwp-windows-msvc %~2 + @REM ^ the above was the old way to build with nightly toolchain before rustup v1.25. + rustup run nightly cargo build -Z build-std=std,panic_abort --target !cargoArch!-uwp-windows-msvc %~2 ) diff --git a/alvr/xtask/src/main.rs b/alvr/xtask/src/main.rs index e046645a87..c22d2a0b72 100644 --- a/alvr/xtask/src/main.rs +++ b/alvr/xtask/src/main.rs @@ -365,14 +365,18 @@ fn find_linked_native_paths( // let package = match metadata.root_package() { // Some(p) => p, // None => return Err("cargo out-dir must be run from within a crate".into()), - // }; + // }; + let mut cmd = "cargo"; let mut args = vec!["check", "--message-format=json", "--quiet"]; if nightly { - args.insert(0, "+nightly"); + cmd = "rustup"; + let mut args1 = vec!["run", "nightly", "cargo"]; + args1.append(&mut args); + args = args1; } args.extend(build_flags.split_ascii_whitespace()); - - let mut command = std::process::Command::new("cargo") + + let mut command = std::process::Command::new(&cmd) .current_dir(crate_path) .args(&args) .stdout(Stdio::piped())