@@ -107,38 +107,26 @@ pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Resu
107
107
rustflags. push_str ( " -Cpanic=abort -Zpanic-abort-tests" ) ;
108
108
}
109
109
rustflags. push_str ( " -Z force-unstable-if-unmarked" ) ;
110
+ let mut env = env. clone ( ) ;
111
+
112
+ let mut args: Vec < & dyn AsRef < OsStr > > = vec ! [ & "cargo" , & "build" , & "--target" , & config. target] ;
113
+
110
114
if config. no_default_features {
111
115
rustflags. push_str ( " -Csymbol-mangling-version=v0" ) ;
116
+ args. push ( & "--no-default-features" ) ;
112
117
}
113
- let mut env = env . clone ( ) ;
118
+
114
119
let channel = if config. sysroot_release_channel {
115
- env. insert (
116
- "RUSTFLAGS" . to_string ( ) ,
117
- format ! ( "{} -Zmir-opt-level=3" , rustflags) ,
118
- ) ;
119
- run_command_with_output_and_env (
120
- & [
121
- & "cargo" ,
122
- & "build" ,
123
- & "--release" ,
124
- & "--target" ,
125
- & config. target ,
126
- ] ,
127
- Some ( start_dir) ,
128
- Some ( & env) ,
129
- ) ?;
120
+ rustflags. push_str ( " -Zmir-opt-level=3" ) ;
121
+ args. push ( & "--release" ) ;
130
122
"release"
131
123
} else {
132
- env. insert ( "RUSTFLAGS" . to_string ( ) , rustflags) ;
133
-
134
- run_command_with_output_and_env (
135
- & [ & "cargo" , & "build" , & "--target" , & config. target ] ,
136
- Some ( start_dir) ,
137
- Some ( & env) ,
138
- ) ?;
139
124
"debug"
140
125
} ;
141
126
127
+ env. insert ( "RUSTFLAGS" . to_string ( ) , rustflags) ;
128
+ run_command_with_output_and_env ( & args, Some ( start_dir) , Some ( & env) ) ?;
129
+
142
130
// Copy files to sysroot
143
131
let sysroot_path = start_dir. join ( format ! ( "sysroot/lib/rustlib/{}/lib/" , config. target_triple) ) ;
144
132
fs:: create_dir_all ( & sysroot_path) . map_err ( |error| {
0 commit comments