Skip to content

Commit f58b371

Browse files
committed
add nightly toolchain to setup
1 parent 8c07e30 commit f58b371

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

crates/xtask/src/main.rs

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,22 +1318,45 @@ impl Xtasks {
13181318
None,
13191319
)?;
13201320

1321-
// install llvm-tools and clippy
1321+
// install nightly toolchaing for bevy api gen
1322+
let toolchain = Self::read_rust_toolchain(&Self::codegen_crate_dir(&app_settings)?);
1323+
Self::run_system_command(
1324+
&app_settings,
1325+
"rustup",
1326+
"Failed to install nightly toolchain",
1327+
vec!["toolchain", "install", toolchain.as_str()],
1328+
None,
1329+
)?;
1330+
1331+
let rustup_components_args = [
1332+
"component",
1333+
"add",
1334+
"rust-src",
1335+
"rustc-dev",
1336+
"clippy",
1337+
"llvm-tools-preview",
1338+
];
1339+
1340+
// install components for the stable and nightly toolchains
13221341
Self::run_system_command(
13231342
&app_settings,
13241343
"rustup",
13251344
"Failed to install rust components",
1326-
vec![
1327-
"component",
1328-
"add",
1329-
"rust-src",
1330-
"rustc-dev",
1331-
"clippy",
1332-
"llvm-tools-preview",
1333-
],
1345+
rustup_components_args,
13341346
None,
13351347
)?;
13361348

1349+
// add components on nightly toolchain
1350+
Self::run_system_command(
1351+
&app_settings,
1352+
"rustup",
1353+
"Failed to install nightly components",
1354+
rustup_components_args
1355+
.iter()
1356+
.chain(["--toolchain", toolchain.as_str()].iter()),
1357+
Some(Path::new(".")),
1358+
)?;
1359+
13371360
Ok(())
13381361
}
13391362
}

0 commit comments

Comments
 (0)