File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -287,7 +287,6 @@ impl Config {
287
287
config. docs = true ;
288
288
config. rust_rpath = true ;
289
289
config. rust_codegen_units = 1 ;
290
- config. build = flags. build ;
291
290
config. channel = "dev" . to_string ( ) ;
292
291
config. codegen_tests = true ;
293
292
config. rust_dist_src = true ;
@@ -316,6 +315,11 @@ impl Config {
316
315
317
316
let build = toml. build . clone ( ) . unwrap_or ( Build :: default ( ) ) ;
318
317
set ( & mut config. build , build. build . clone ( ) . map ( |x| INTERNER . intern_string ( x) ) ) ;
318
+ set ( & mut config. build , flags. build ) ;
319
+ if config. build . is_empty ( ) {
320
+ // set by bootstrap.py
321
+ config. build = INTERNER . intern_str ( & env:: var ( "BUILD" ) . unwrap ( ) ) ;
322
+ }
319
323
config. hosts . push ( config. build . clone ( ) ) ;
320
324
for host in build. host . iter ( ) {
321
325
let host = INTERNER . intern_str ( host) ;
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ pub struct Flags {
33
33
pub on_fail : Option < String > ,
34
34
pub stage : Option < u32 > ,
35
35
pub keep_stage : Option < u32 > ,
36
- pub build : Interned < String > ,
36
+ pub build : Option < Interned < String > > ,
37
37
38
38
pub host : Vec < Interned < String > > ,
39
39
pub target : Vec < Interned < String > > ,
@@ -327,9 +327,7 @@ Arguments:
327
327
stage : stage,
328
328
on_fail : matches. opt_str ( "on-fail" ) ,
329
329
keep_stage : matches. opt_str ( "keep-stage" ) . map ( |j| j. parse ( ) . unwrap ( ) ) ,
330
- build : INTERNER . intern_string ( matches. opt_str ( "build" ) . unwrap_or_else ( || {
331
- env:: var ( "BUILD" ) . unwrap ( )
332
- } ) ) ,
330
+ build : matches. opt_str ( "build" ) . map ( |s| INTERNER . intern_string ( s) ) ,
333
331
host : split ( matches. opt_strs ( "host" ) )
334
332
. into_iter ( ) . map ( |x| INTERNER . intern_string ( x) ) . collect :: < Vec < _ > > ( ) ,
335
333
target : split ( matches. opt_strs ( "target" ) )
You can’t perform that action at this time.
0 commit comments