Skip to content

Commit

Permalink
Fixes xtask build script for UWP/hololens2 builds.
Browse files Browse the repository at this point in the history
Fixes xtask build script for  UWP/hololens2 builds, caused by changes in rustup 1.25

rust-lang/rustup#3036
  • Loading branch information
korejan committed Aug 3, 2022
1 parent dc2249c commit 61df17b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion alvr/openxr-client/alxr-client/uwp/cargo_build_uwp.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
12 changes: 8 additions & 4 deletions alvr/xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 61df17b

Please sign in to comment.