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 @@ -290,7 +290,6 @@ impl Config {
290
290
config. docs = true ;
291
291
config. rust_rpath = true ;
292
292
config. rust_codegen_units = 1 ;
293
- config. build = flags. build ;
294
293
config. channel = "dev" . to_string ( ) ;
295
294
config. codegen_tests = true ;
296
295
config. rust_dist_src = true ;
@@ -319,6 +318,11 @@ impl Config {
319
318
320
319
let build = toml. build . clone ( ) . unwrap_or ( Build :: default ( ) ) ;
321
320
set ( & mut config. build , build. build . clone ( ) . map ( |x| INTERNER . intern_string ( x) ) ) ;
321
+ set ( & mut config. build , flags. build ) ;
322
+ if config. build . is_empty ( ) {
323
+ // set by bootstrap.py
324
+ config. build = INTERNER . intern_str ( & env:: var ( "BUILD" ) . unwrap ( ) ) ;
325
+ }
322
326
config. hosts . push ( config. build . clone ( ) ) ;
323
327
for host in build. host . iter ( ) {
324
328
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