@@ -27,17 +27,14 @@ pub fn check_rustc_version(step: &Step) -> Result<String, Error> {
27
27
}
28
28
29
29
/// Ensure that `rustup` has the `wasm32-unknown-unknown` target installed for
30
- /// the `nightly` toolchain.
30
+ /// current toolchain
31
31
pub fn rustup_add_wasm_target ( step : & Step ) -> Result < ( ) , Error > {
32
32
let msg = format ! ( "{}Adding WASM target..." , emoji:: TARGET ) ;
33
33
PBAR . step ( step, & msg) ;
34
- ensure_nightly ( ) ?;
35
34
let output = Command :: new ( "rustup" )
36
35
. arg ( "target" )
37
36
. arg ( "add" )
38
37
. arg ( "wasm32-unknown-unknown" )
39
- . arg ( "--toolchain" )
40
- . arg ( "nightly" )
41
38
. output ( ) ?;
42
39
if !output. status . success ( ) {
43
40
let s = String :: from_utf8_lossy ( & output. stderr ) ;
@@ -47,34 +44,13 @@ pub fn rustup_add_wasm_target(step: &Step) -> Result<(), Error> {
47
44
}
48
45
}
49
46
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`.
69
48
pub fn cargo_build_wasm ( path : & Path , debug : bool , step : & Step ) -> Result < ( ) , Error > {
70
49
let msg = format ! ( "{}Compiling to WASM..." , emoji:: CYCLONE ) ;
71
50
PBAR . step ( step, & msg) ;
72
51
let output = {
73
52
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" ) ;
78
54
if !debug {
79
55
cmd. arg ( "--release" ) ;
80
56
}
@@ -90,15 +66,11 @@ pub fn cargo_build_wasm(path: &Path, debug: bool, step: &Step) -> Result<(), Err
90
66
}
91
67
}
92
68
93
- /// Run `cargo build --tests` with the `nightly` toolchain and targetting
94
- /// `wasm32-unknown-unknown`.
69
+ /// Run `cargo build --tests` targetting `wasm32-unknown-unknown`.
95
70
pub fn cargo_build_wasm_tests ( path : & Path , debug : bool ) -> Result < ( ) , Error > {
96
71
let output = {
97
72
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" ) ;
102
74
if !debug {
103
75
cmd. arg ( "--release" ) ;
104
76
}
0 commit comments