Skip to content

Commit 4caa0b0

Browse files
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 29bce6e commit 4caa0b0

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Diff for: 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
}

Diff for: 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;
@@ -410,6 +410,12 @@ impl Config {
410410
set(&mut config.rust_dist_src, t.src_tarball);
411411
}
412412

413+
414+
// compat with `./configure` while we're still using that
415+
if fs::metadata("config.mk").is_ok() {
416+
config.update_with_config_mk();
417+
}
418+
413419
return config
414420
}
415421

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

0 commit comments

Comments
 (0)