Skip to content

Commit b5373f4

Browse files
feat(build): remove all mention of nightly
1 parent 2bef9af commit b5373f4

File tree

1 file changed

+5
-33
lines changed

1 file changed

+5
-33
lines changed

src/build.rs

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,14 @@ pub fn check_rustc_version(step: &Step) -> Result<String, Error> {
2727
}
2828

2929
/// Ensure that `rustup` has the `wasm32-unknown-unknown` target installed for
30-
/// the `nightly` toolchain.
30+
/// current toolchain
3131
pub fn rustup_add_wasm_target(step: &Step) -> Result<(), Error> {
3232
let msg = format!("{}Adding WASM target...", emoji::TARGET);
3333
PBAR.step(step, &msg);
34-
ensure_nightly()?;
3534
let output = Command::new("rustup")
3635
.arg("target")
3736
.arg("add")
3837
.arg("wasm32-unknown-unknown")
39-
.arg("--toolchain")
40-
.arg("nightly")
4138
.output()?;
4239
if !output.status.success() {
4340
let s = String::from_utf8_lossy(&output.stderr);
@@ -47,34 +44,13 @@ pub fn rustup_add_wasm_target(step: &Step) -> Result<(), Error> {
4744
}
4845
}
4946

50-
/// Ensure that the `nightly` toolchain is installed in `rustup`.
51-
fn ensure_nightly() -> Result<(), Error> {
52-
let nightly_check = Command::new("rustc").arg("+nightly").arg("-V").output()?;
53-
if !nightly_check.status.success() {
54-
let res = Command::new("rustup")
55-
.arg("toolchain")
56-
.arg("install")
57-
.arg("nightly")
58-
.output()?;
59-
if !res.status.success() {
60-
let s = String::from_utf8_lossy(&res.stderr);
61-
return Error::cli("Adding the nightly toolchain failed", s);
62-
}
63-
}
64-
Ok(())
65-
}
66-
67-
/// Run `cargo build` with the `nightly` toolchain and targetting
68-
/// `wasm32-unknown-unknown`.
47+
/// Run `cargo build` targetting `wasm32-unknown-unknown`.
6948
pub fn cargo_build_wasm(path: &Path, debug: bool, step: &Step) -> Result<(), Error> {
7049
let msg = format!("{}Compiling to WASM...", emoji::CYCLONE);
7150
PBAR.step(step, &msg);
7251
let output = {
7352
let mut cmd = Command::new("cargo");
74-
cmd.current_dir(path)
75-
.arg("+nightly")
76-
.arg("build")
77-
.arg("--lib");
53+
cmd.current_dir(path).arg("build").arg("--lib");
7854
if !debug {
7955
cmd.arg("--release");
8056
}
@@ -90,15 +66,11 @@ pub fn cargo_build_wasm(path: &Path, debug: bool, step: &Step) -> Result<(), Err
9066
}
9167
}
9268

93-
/// Run `cargo build --tests` with the `nightly` toolchain and targetting
94-
/// `wasm32-unknown-unknown`.
69+
/// Run `cargo build --tests` targetting `wasm32-unknown-unknown`.
9570
pub fn cargo_build_wasm_tests(path: &Path, debug: bool) -> Result<(), Error> {
9671
let output = {
9772
let mut cmd = Command::new("cargo");
98-
cmd.current_dir(path)
99-
.arg("+nightly")
100-
.arg("build")
101-
.arg("--tests");
73+
cmd.current_dir(path).arg("build").arg("--tests");
10274
if !debug {
10375
cmd.arg("--release");
10476
}

0 commit comments

Comments
 (0)