Skip to content

Commit d687176

Browse files
Mark-Simulacrumbrson
authored andcommitted
Fixes bootstrapping with custom cargo/rustc.
config.mk is now always read when parsing the configuration to prevent this from reoccurring in the future, hopefully.
1 parent 4795a8f commit d687176

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/bootstrap/bin/main.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ use bootstrap::{Flags, Config, Build};
2626
fn main() {
2727
let args = env::args().skip(1).collect::<Vec<_>>();
2828
let flags = Flags::parse(&args);
29-
let mut config = Config::parse(&flags.build, flags.config.clone());
30-
31-
// compat with `./configure` while we're still using that
32-
if std::fs::metadata("config.mk").is_ok() {
33-
config.update_with_config_mk();
34-
}
35-
29+
let config = Config::parse(&flags.build, flags.config.clone());
3630
Build::new(flags, config).build();
3731
}

src/bootstrap/config.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
1616
use std::collections::HashMap;
1717
use std::env;
18-
use std::fs::File;
18+
use std::fs::{self, File};
1919
use std::io::prelude::*;
2020
use std::path::PathBuf;
2121
use std::process;
@@ -404,6 +404,12 @@ impl Config {
404404
set(&mut config.rust_dist_src, t.src_tarball);
405405
}
406406

407+
408+
// compat with `./configure` while we're still using that
409+
if fs::metadata("config.mk").is_ok() {
410+
config.update_with_config_mk();
411+
}
412+
407413
return config
408414
}
409415

@@ -412,7 +418,7 @@ impl Config {
412418
/// While we still have `./configure` this implements the ability to decode
413419
/// that configuration into this. This isn't exactly a full-blown makefile
414420
/// parser, but hey it gets the job done!
415-
pub fn update_with_config_mk(&mut self) {
421+
fn update_with_config_mk(&mut self) {
416422
let mut config = String::new();
417423
File::open("config.mk").unwrap().read_to_string(&mut config).unwrap();
418424
for line in config.lines() {

0 commit comments

Comments
 (0)