]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #38072 - nikomatsakis:bootstrap-incremental, r=acrichto
authorbors <bors@rust-lang.org>
Mon, 19 Dec 2016 20:07:49 +0000 (20:07 +0000)
committerbors <bors@rust-lang.org>
Mon, 19 Dec 2016 20:07:49 +0000 (20:07 +0000)
add preliminary support for incremental compilation to rustbuild.py

This implements the integration described in #37929. It requires the use of a local nightly as your bootstrap compiler. The setup is described in `src/bootstrap/README.md`.

This does NOT implement the "copy stage0 libs to stage1" optimization described in #37929, just because that seems orthogonal to me.

In local testing, I do not yet see any incremental re-use when building rustc. I'm not sure why that is, more investigation needed.

(For these reasons, this is not marked as fixing the relevant issue.)

r? @alexcrichton -- I included one random cleanup (`Step::noop()`) that turned out to not be especially relevant. Feel free to tell me you liked it better the old way.

1  2 
src/bootstrap/bin/rustc.rs

index c5684e69994ea86618740f82ff9ba62c4cae663b,a17b0c53d0ae4c43f69649822eea73308bf8fdfc..2fa4363e658a43f379a7d711b2e759500bed546b
@@@ -29,8 -29,11 +29,11 @@@ extern crate bootstrap
  
  use std::env;
  use std::ffi::OsString;
+ use std::io;
+ use std::io::prelude::*;
+ use std::str::FromStr;
  use std::path::PathBuf;
 -use std::process::Command;
 +use std::process::{Command, ExitStatus};
  
  fn main() {
      let args = env::args_os().skip(1).collect::<Vec<_>>();
          }
      }
  
+     if verbose > 1 {
+         writeln!(&mut io::stderr(), "rustc command: {:?}", cmd).unwrap();
+     }
      // Actually run the compiler!
 -    std::process::exit(match cmd.status() {
 -        Ok(s) => s.code().unwrap_or(1),
 +    std::process::exit(match exec_cmd(&mut cmd) {
 +        Ok(s) => s.code().unwrap_or(0xfe),
          Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
      })
  }