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.
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),
})
}