@@ -19,7 +19,8 @@ fn configure(cmd: &str, host: &[&str], target: &[&str]) -> Config {
19
19
}
20
20
21
21
fn configure_with_args ( cmd : & [ String ] , host : & [ & str ] , target : & [ & str ] ) -> Config {
22
- let mut config = Config :: parse ( Flags :: parse ( cmd) ) ;
22
+ let ( flags, exec_ctx) = Flags :: parse ( cmd) ;
23
+ let mut config = Config :: parse ( flags, exec_ctx) ;
23
24
// don't save toolstates
24
25
config. save_toolstates = None ;
25
26
config. dry_run = DryRun :: SelfCheck ;
@@ -30,10 +31,11 @@ fn configure_with_args(cmd: &[String], host: &[&str], target: &[&str]) -> Config
30
31
// The src/doc/book submodule is needed because TheBook step tries to
31
32
// access files even during a dry-run (may want to consider just skipping
32
33
// that in a dry run).
34
+ let ( flags, exec_ctx) = Flags :: parse ( & [ "check" . to_owned ( ) ] ) ;
33
35
let submodule_build = Build :: new ( Config {
34
36
// don't include LLVM, so CI doesn't require ninja/cmake to be installed
35
37
rust_codegen_backends : vec ! [ ] ,
36
- ..Config :: parse ( Flags :: parse ( & [ "check" . to_owned ( ) ] ) )
38
+ ..Config :: parse ( flags , exec_ctx )
37
39
} ) ;
38
40
submodule_build. require_submodule ( "src/doc/book" , None ) ;
39
41
config. submodules = Some ( false ) ;
@@ -291,18 +293,16 @@ fn prepare_rustc_checkout(ctx: &mut GitCtx) {
291
293
292
294
/// Parses a Config directory from `path`, with the given value of `download_rustc`.
293
295
fn parse_config_download_rustc_at ( path : & Path , download_rustc : & str , ci : bool ) -> Config {
294
- Config :: parse_inner (
295
- Flags :: parse ( & [
296
- "build" . to_owned ( ) ,
297
- "--dry-run" . to_owned ( ) ,
298
- "--ci" . to_owned ( ) ,
299
- if ci { "true" } else { "false" } . to_owned ( ) ,
300
- format ! ( "--set=rust.download-rustc='{download_rustc}'" ) ,
301
- "--src" . to_owned ( ) ,
302
- path. to_str ( ) . unwrap ( ) . to_owned ( ) ,
303
- ] ) ,
304
- |& _| Ok ( Default :: default ( ) ) ,
305
- )
296
+ let ( flags, exec_ctx) = Flags :: parse ( & [
297
+ "build" . to_owned ( ) ,
298
+ "--dry-run" . to_owned ( ) ,
299
+ "--ci" . to_owned ( ) ,
300
+ if ci { "true" } else { "false" } . to_owned ( ) ,
301
+ format ! ( "--set=rust.download-rustc='{download_rustc}'" ) ,
302
+ "--src" . to_owned ( ) ,
303
+ path. to_str ( ) . unwrap ( ) . to_owned ( ) ,
304
+ ] ) ;
305
+ Config :: parse_inner ( flags, |& _| Ok ( Default :: default ( ) ) , exec_ctx)
306
306
}
307
307
308
308
mod defaults {
@@ -692,7 +692,8 @@ mod dist {
692
692
host = ["i686-unknown-netbsd"]
693
693
target = ["i686-unknown-netbsd"]
694
694
"# ;
695
- let config = Config :: parse_inner ( Flags :: parse ( cmd_args) , |& _| toml:: from_str ( config_str) ) ;
695
+ let ( flags, exec_ctx) = Flags :: parse ( cmd_args) ;
696
+ let config = Config :: parse_inner ( flags, |& _| toml:: from_str ( config_str) , exec_ctx) ;
696
697
let mut cache = run_build ( & [ ] , config) ;
697
698
698
699
// Stage 2 `compile::Rustc` should **NEVER** be cached here.
@@ -1047,14 +1048,12 @@ fn test_test_coverage() {
1047
1048
#[ test]
1048
1049
fn test_prebuilt_llvm_config_path_resolution ( ) {
1049
1050
fn configure ( config : & str ) -> Config {
1050
- Config :: parse_inner (
1051
- Flags :: parse ( & [
1052
- "build" . to_string ( ) ,
1053
- "--dry-run" . to_string ( ) ,
1054
- "--config=/does/not/exist" . to_string ( ) ,
1055
- ] ) ,
1056
- |& _| toml:: from_str ( & config) ,
1057
- )
1051
+ let ( flags, exec_ctx) = Flags :: parse ( & [
1052
+ "build" . to_string ( ) ,
1053
+ "--dry-run" . to_string ( ) ,
1054
+ "--config=/does/not/exist" . to_string ( ) ,
1055
+ ] ) ;
1056
+ Config :: parse_inner ( flags, |& _| toml:: from_str ( & config) , exec_ctx)
1058
1057
}
1059
1058
1060
1059
// Removes Windows disk prefix if present
0 commit comments