]> git.lizzy.rs Git - rust.git/commitdiff
Fixes bootstrapping with custom cargo/rustc.
authorMark Simulacrum <mark.simulacrum@gmail.com>
Wed, 21 Jun 2017 00:04:36 +0000 (18:04 -0600)
committerMark Simulacrum <mark.simulacrum@gmail.com>
Wed, 21 Jun 2017 00:05:34 +0000 (18:05 -0600)
config.mk is now always read when parsing the configuration to prevent
this from reoccurring in the future, hopefully.

src/bootstrap/bin/main.rs
src/bootstrap/config.rs

index 5ca5ce1648f2fc80ee0735f723dc5523333a2e26..5ef18b89841f0e6f28598e6fe08048832ee13def 100644 (file)
 fn main() {
     let args = env::args().skip(1).collect::<Vec<_>>();
     let flags = Flags::parse(&args);
-    let mut config = Config::parse(&flags.build, flags.config.clone());
-
-    // compat with `./configure` while we're still using that
-    if std::fs::metadata("config.mk").is_ok() {
-        config.update_with_config_mk();
-    }
-
+    let config = Config::parse(&flags.build, flags.config.clone());
     Build::new(flags, config).build();
 }
index fd8aa320fb3d7408ba89801d2d3a87aaf3992791..902cd0997a8ed4227ef7703bc92d878556b11392 100644 (file)
@@ -15,7 +15,7 @@
 
 use std::collections::HashMap;
 use std::env;
-use std::fs::File;
+use std::fs::{self, File};
 use std::io::prelude::*;
 use std::path::PathBuf;
 use std::process;
@@ -410,6 +410,12 @@ pub fn parse(build: &str, file: Option<PathBuf>) -> Config {
             set(&mut config.rust_dist_src, t.src_tarball);
         }
 
+
+        // compat with `./configure` while we're still using that
+        if fs::metadata("config.mk").is_ok() {
+            config.update_with_config_mk();
+        }
+
         return config
     }
 
@@ -418,7 +424,7 @@ pub fn parse(build: &str, file: Option<PathBuf>) -> Config {
     /// While we still have `./configure` this implements the ability to decode
     /// that configuration into this. This isn't exactly a full-blown makefile
     /// parser, but hey it gets the job done!
-    pub fn update_with_config_mk(&mut self) {
+    fn update_with_config_mk(&mut self) {
         let mut config = String::new();
         File::open("config.mk").unwrap().read_to_string(&mut config).unwrap();
         for line in config.lines() {