builder.ensure(StartupObjects { compiler, target });
- if builder.force_use_stage1(compiler, target) {
- let from = builder.compiler(1, builder.config.build);
+ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
+ if compiler_to_use != compiler {
builder.ensure(Std {
- compiler: from,
+ compiler: compiler_to_use,
target,
});
- builder.info(&format!("Uplifting stage1 std ({} -> {})", from.host, target));
+ builder.info(&format!("Uplifting stage1 std ({} -> {})", compiler_to_use.host, target));
// Even if we're not building std this stage, the new sysroot must
// still contain the third party objects needed by various targets.
copy_third_party_objects(builder, &compiler, target);
builder.ensure(StdLink {
- compiler: from,
+ compiler: compiler_to_use,
target_compiler: compiler,
target,
});
&compiler.host, target));
run_cargo(builder,
&mut cargo,
+ vec![],
&libstd_stamp(builder, compiler, target),
false);
if !up_to_date(src_file, dst_file) {
let mut cmd = Command::new(&builder.initial_rustc);
builder.run(cmd.env("RUSTC_BOOTSTRAP", "1")
- .arg("--cfg").arg("stage0")
+ .arg("--cfg").arg("bootstrap")
.arg("--target").arg(target)
.arg("--emit=obj")
.arg("-o").arg(dst_file)
return;
}
- if builder.force_use_stage1(compiler, target) {
+ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
+ if compiler_to_use != compiler {
builder.ensure(Test {
- compiler: builder.compiler(1, builder.config.build),
+ compiler: compiler_to_use,
target,
});
builder.info(
&format!("Uplifting stage1 test ({} -> {})", builder.config.build, target));
builder.ensure(TestLink {
- compiler: builder.compiler(1, builder.config.build),
+ compiler: compiler_to_use,
target_compiler: compiler,
target,
});
&compiler.host, target));
run_cargo(builder,
&mut cargo,
+ vec![],
&libtest_stamp(builder, compiler, target),
false);
return;
}
- if builder.force_use_stage1(compiler, target) {
+ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
+ if compiler_to_use != compiler {
builder.ensure(Rustc {
- compiler: builder.compiler(1, builder.config.build),
+ compiler: compiler_to_use,
target,
});
builder.info(&format!("Uplifting stage1 rustc ({} -> {})",
builder.config.build, target));
builder.ensure(RustcLink {
- compiler: builder.compiler(1, builder.config.build),
+ compiler: compiler_to_use,
target_compiler: compiler,
target,
});
compiler.stage, &compiler.host, target));
run_cargo(builder,
&mut cargo,
+ vec![],
&librustc_stamp(builder, compiler, target),
false);
let libdir_relative = builder.config.libdir_relative().unwrap_or(Path::new("lib"));
cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative);
- // If we're not building a compiler with debugging information then remove
- // these two env vars which would be set otherwise.
- if builder.config.rust_debuginfo_only_std {
- cargo.env_remove("RUSTC_DEBUGINFO");
- cargo.env_remove("RUSTC_DEBUGINFO_LINES");
- }
-
if let Some(ref ver_date) = builder.rust_info.commit_date() {
cargo.env("CFG_VER_DATE", ver_date);
}
return;
}
- if builder.force_use_stage1(compiler, target) {
+ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
+ if compiler_to_use != compiler {
builder.ensure(CodegenBackend {
- compiler: builder.compiler(1, builder.config.build),
+ compiler: compiler_to_use,
target,
backend,
});
let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage));
let files = run_cargo(builder,
cargo.arg("--features").arg(features),
+ vec![],
&tmp_stamp,
false);
if builder.config.dry_run {
pub fn run_cargo(builder: &Builder<'_>,
cargo: &mut Command,
+ tail_args: Vec<String>,
stamp: &Path,
is_check: bool)
-> Vec<PathBuf>
// files we need to probe for later.
let mut deps = Vec::new();
let mut toplevel = Vec::new();
- let ok = stream_cargo(builder, cargo, &mut |msg| {
+ let ok = stream_cargo(builder, cargo, tail_args, &mut |msg| {
let (filenames, crate_types) = match msg {
CargoMessage::CompilerArtifact {
filenames,
},
..
} => (filenames, crate_types),
+ CargoMessage::CompilerMessage { message } => {
+ eprintln!("{}", message.rendered);
+ return;
+ }
_ => return,
};
for filename in filenames {
pub fn stream_cargo(
builder: &Builder<'_>,
cargo: &mut Command,
+ tail_args: Vec<String>,
cb: &mut dyn FnMut(CargoMessage<'_>),
) -> bool {
if builder.config.dry_run {
cargo.arg("--message-format").arg("json")
.stdout(Stdio::piped());
+ for arg in tail_args {
+ cargo.arg(arg);
+ }
+
builder.verbose(&format!("running: {:?}", cargo));
let mut child = match cargo.spawn() {
Ok(child) => child,
},
BuildScriptExecuted {
package_id: Cow<'a, str>,
+ },
+ CompilerMessage {
+ message: ClippyMessage<'a>
}
}
+
+#[derive(Deserialize)]
+pub struct ClippyMessage<'a> {
+ rendered: Cow<'a, str>,
+}