2018-12-04 19:26:54 +01:00
|
|
|
//! Implementation of compiling the compiler and standard library, in "check"-based modes.
|
2018-01-15 18:44:00 +01:00
|
|
|
|
2020-10-10 06:47:15 +02:00
|
|
|
use crate::builder::{Builder, Kind, RunConfig, ShouldRun, Step};
|
2020-10-15 14:23:43 +02:00
|
|
|
use crate::cache::Interned;
|
|
|
|
use crate::compile::{add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo};
|
2020-07-17 16:08:04 +02:00
|
|
|
use crate::config::TargetSelection;
|
2018-12-07 13:21:05 +01:00
|
|
|
use crate::tool::{prepare_tool_cargo, SourceType};
|
2020-10-15 14:23:43 +02:00
|
|
|
use crate::INTERNER;
|
2020-09-30 02:24:14 +02:00
|
|
|
use crate::{Compiler, Mode, Subcommand};
|
2018-01-15 18:44:00 +01:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
|
|
|
pub struct Std {
|
2020-07-17 16:08:04 +02:00
|
|
|
pub target: TargetSelection,
|
2018-01-15 18:44:00 +01:00
|
|
|
}
|
|
|
|
|
2020-09-30 02:24:14 +02:00
|
|
|
/// Returns args for the subcommand itself (not for cargo)
|
|
|
|
fn args(builder: &Builder<'_>) -> Vec<String> {
|
2020-10-27 02:18:28 +01:00
|
|
|
fn strings<'a>(arr: &'a [&str]) -> impl Iterator<Item = String> + 'a {
|
|
|
|
arr.iter().copied().map(String::from)
|
|
|
|
}
|
|
|
|
|
2020-09-30 02:24:14 +02:00
|
|
|
if let Subcommand::Clippy { fix, .. } = builder.config.cmd {
|
2021-01-04 02:20:42 +01:00
|
|
|
// disable the most spammy clippy lints
|
|
|
|
let ignored_lints = vec![
|
|
|
|
"many_single_char_names", // there are a lot in stdarch
|
|
|
|
"collapsible_if",
|
|
|
|
"type_complexity",
|
|
|
|
"missing_safety_doc", // almost 3K warnings
|
|
|
|
"too_many_arguments",
|
|
|
|
"needless_lifetimes", // people want to keep the lifetimes
|
|
|
|
"wrong_self_convention",
|
|
|
|
];
|
2020-10-27 02:18:28 +01:00
|
|
|
let mut args = vec![];
|
2020-09-30 02:24:14 +02:00
|
|
|
if fix {
|
2020-10-27 02:18:28 +01:00
|
|
|
#[rustfmt::skip]
|
|
|
|
args.extend(strings(&[
|
|
|
|
"--fix", "-Zunstable-options",
|
|
|
|
// FIXME: currently, `--fix` gives an error while checking tests for libtest,
|
|
|
|
// possibly because libtest is not yet built in the sysroot.
|
|
|
|
// As a workaround, avoid checking tests and benches when passed --fix.
|
|
|
|
"--lib", "--bins", "--examples",
|
|
|
|
]));
|
2020-09-30 02:24:14 +02:00
|
|
|
}
|
2020-10-27 02:18:28 +01:00
|
|
|
args.extend(strings(&["--", "--cap-lints", "warn"]));
|
2021-01-04 02:20:42 +01:00
|
|
|
args.extend(ignored_lints.iter().map(|lint| format!("-Aclippy::{}", lint)));
|
2020-09-30 02:24:14 +02:00
|
|
|
args
|
|
|
|
} else {
|
|
|
|
vec![]
|
2018-12-04 19:26:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn cargo_subcommand(kind: Kind) -> &'static str {
|
|
|
|
match kind {
|
|
|
|
Kind::Check => "check",
|
|
|
|
Kind::Clippy => "clippy",
|
|
|
|
Kind::Fix => "fix",
|
2019-12-22 23:42:04 +01:00
|
|
|
_ => unreachable!(),
|
2018-12-04 19:26:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-15 18:44:00 +01:00
|
|
|
impl Step for Std {
|
|
|
|
type Output = ();
|
|
|
|
const DEFAULT: bool = true;
|
|
|
|
|
2019-02-25 11:30:32 +01:00
|
|
|
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
2019-08-27 17:32:21 +02:00
|
|
|
run.all_krates("test")
|
2018-01-15 18:44:00 +01:00
|
|
|
}
|
|
|
|
|
2019-02-25 11:30:32 +01:00
|
|
|
fn make_run(run: RunConfig<'_>) {
|
2019-12-22 23:42:04 +01:00
|
|
|
run.builder.ensure(Std { target: run.target });
|
2018-01-15 18:44:00 +01:00
|
|
|
}
|
|
|
|
|
2019-02-25 11:30:32 +01:00
|
|
|
fn run(self, builder: &Builder<'_>) {
|
2018-01-15 18:44:00 +01:00
|
|
|
let target = self.target;
|
2021-01-16 03:43:23 +01:00
|
|
|
let compiler = builder.compiler(builder.top_stage, builder.config.build);
|
2018-01-15 18:44:00 +01:00
|
|
|
|
2020-06-13 00:44:56 +02:00
|
|
|
let mut cargo = builder.cargo(
|
|
|
|
compiler,
|
|
|
|
Mode::Std,
|
|
|
|
SourceType::InTree,
|
|
|
|
target,
|
|
|
|
cargo_subcommand(builder.kind),
|
|
|
|
);
|
2020-04-19 13:17:38 +02:00
|
|
|
std_cargo(builder, target, compiler.stage, &mut cargo);
|
2018-03-16 16:35:03 +01:00
|
|
|
|
2021-01-16 04:34:00 +01:00
|
|
|
builder.info(&format!(
|
|
|
|
"Checking stage{} std artifacts ({} -> {})",
|
|
|
|
builder.top_stage, &compiler.host, target
|
|
|
|
));
|
2019-12-22 23:42:04 +01:00
|
|
|
run_cargo(
|
|
|
|
builder,
|
|
|
|
cargo,
|
2020-09-30 02:24:14 +02:00
|
|
|
args(builder),
|
2019-12-22 23:42:04 +01:00
|
|
|
&libstd_stamp(builder, compiler, target),
|
|
|
|
vec![],
|
|
|
|
true,
|
|
|
|
);
|
2018-03-16 16:35:03 +01:00
|
|
|
|
2021-01-16 03:43:23 +01:00
|
|
|
// We skip populating the sysroot in non-zero stage because that'll lead
|
|
|
|
// to rlib/rmeta conflicts if std gets built during this session.
|
|
|
|
if compiler.stage == 0 {
|
|
|
|
let libdir = builder.sysroot_libdir(compiler, target);
|
|
|
|
let hostdir = builder.sysroot_libdir(compiler, compiler.host);
|
|
|
|
add_to_sysroot(&builder, &libdir, &hostdir, &libstd_stamp(builder, compiler, target));
|
|
|
|
}
|
2020-09-02 22:41:36 +02:00
|
|
|
|
|
|
|
// Then run cargo again, once we've put the rmeta files for the library
|
|
|
|
// crates into the sysroot. This is needed because e.g., core's tests
|
|
|
|
// depend on `libtest` -- Cargo presumes it will exist, but it doesn't
|
|
|
|
// since we initialize with an empty sysroot.
|
|
|
|
//
|
|
|
|
// Currently only the "libtest" tree of crates does this.
|
|
|
|
|
2020-10-03 01:51:36 +02:00
|
|
|
if let Subcommand::Check { all_targets: true, .. } = builder.config.cmd {
|
|
|
|
let mut cargo = builder.cargo(
|
|
|
|
compiler,
|
|
|
|
Mode::Std,
|
|
|
|
SourceType::InTree,
|
|
|
|
target,
|
|
|
|
cargo_subcommand(builder.kind),
|
|
|
|
);
|
|
|
|
std_cargo(builder, target, compiler.stage, &mut cargo);
|
|
|
|
cargo.arg("--all-targets");
|
|
|
|
|
|
|
|
// Explicitly pass -p for all dependencies krates -- this will force cargo
|
|
|
|
// to also check the tests/benches/examples for these crates, rather
|
|
|
|
// than just the leaf crate.
|
2020-10-25 13:13:14 +01:00
|
|
|
for krate in builder.in_tree_crates("test", Some(target)) {
|
2020-10-03 01:51:36 +02:00
|
|
|
cargo.arg("-p").arg(krate.name);
|
|
|
|
}
|
2020-09-02 22:41:36 +02:00
|
|
|
|
2020-10-03 01:51:36 +02:00
|
|
|
builder.info(&format!(
|
2021-01-16 04:34:00 +01:00
|
|
|
"Checking stage{} std test/bench/example targets ({} -> {})",
|
|
|
|
builder.top_stage, &compiler.host, target
|
2020-10-03 01:51:36 +02:00
|
|
|
));
|
|
|
|
run_cargo(
|
|
|
|
builder,
|
|
|
|
cargo,
|
2020-09-30 02:24:14 +02:00
|
|
|
args(builder),
|
2020-10-03 01:51:36 +02:00
|
|
|
&libstd_test_stamp(builder, compiler, target),
|
|
|
|
vec![],
|
|
|
|
true,
|
|
|
|
);
|
2020-09-02 22:41:36 +02:00
|
|
|
}
|
2018-01-15 18:44:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
|
|
|
pub struct Rustc {
|
2020-07-17 16:08:04 +02:00
|
|
|
pub target: TargetSelection,
|
2018-01-15 18:44:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Step for Rustc {
|
|
|
|
type Output = ();
|
|
|
|
const ONLY_HOSTS: bool = true;
|
|
|
|
const DEFAULT: bool = true;
|
|
|
|
|
2019-02-25 11:30:32 +01:00
|
|
|
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
Change Step to be invoked with a path when in default mode.
Previously, a Step would be able to tell on its own when it was invoked
"by-default" (that is, `./x.py test` was called instead of `./x.py test
some/path`). This commit replaces that functionality, invoking each Step
with each of the paths it has specified as "should be invoked by."
For example, if a step calls `path("src/tools/cargo")` and
`path("src/doc/cargo")` then it's make_run will be called twice, with
"src/tools/cargo" and "src/doc/cargo." This makes it so that default
handling logic is in builder, instead of spread across various Steps.
However, this meant that some Step specifications needed to be updated,
since for example `rustdoc` can be built by `./x.py build
src/librustdoc` or `./x.py build src/tools/rustdoc`. A `PathSet`
abstraction is added that handles this: now, each Step can not only list
`path(...)` but also `paths(&[a, b, ...])` which will make it so that we
don't invoke it with each of the individual paths, instead invoking it
with the first path in the list (though this shouldn't be depended on).
Future work likely consists of implementing a better/easier way for a
given Step to work with "any" crate in-tree, especially those that want
to run tests, build, or check crates in the std, test, or rustc crate
trees. Currently this is rather painful to do as most of the logic is
duplicated across should_run and make_run. It seems likely this can be
abstracted away into builder somehow.
2018-02-11 17:51:58 +01:00
|
|
|
run.all_krates("rustc-main")
|
2018-01-15 18:44:00 +01:00
|
|
|
}
|
|
|
|
|
2019-02-25 11:30:32 +01:00
|
|
|
fn make_run(run: RunConfig<'_>) {
|
2019-12-22 23:42:04 +01:00
|
|
|
run.builder.ensure(Rustc { target: run.target });
|
2018-01-15 18:44:00 +01:00
|
|
|
}
|
|
|
|
|
2019-02-08 14:53:55 +01:00
|
|
|
/// Builds the compiler.
|
2018-01-15 18:44:00 +01:00
|
|
|
///
|
|
|
|
/// This will build the compiler for a particular stage of the build using
|
|
|
|
/// the `compiler` targeting the `target` architecture. The artifacts
|
|
|
|
/// created will also be linked into the sysroot directory.
|
2019-02-25 11:30:32 +01:00
|
|
|
fn run(self, builder: &Builder<'_>) {
|
2021-01-16 03:43:23 +01:00
|
|
|
let compiler = builder.compiler(builder.top_stage, builder.config.build);
|
2018-01-15 18:44:00 +01:00
|
|
|
let target = self.target;
|
|
|
|
|
2021-01-16 03:43:23 +01:00
|
|
|
if compiler.stage != 0 {
|
|
|
|
// If we're not in stage 0, then we won't have a std from the beta
|
|
|
|
// compiler around. That means we need to make sure there's one in
|
|
|
|
// the sysroot for the compiler to find. Otherwise, we're going to
|
|
|
|
// fail when building crates that need to generate code (e.g., build
|
|
|
|
// scripts and their dependencies).
|
|
|
|
builder.ensure(crate::compile::Std { target: compiler.host, compiler });
|
|
|
|
builder.ensure(crate::compile::Std { target, compiler });
|
|
|
|
} else {
|
|
|
|
builder.ensure(Std { target });
|
|
|
|
}
|
2018-08-02 20:01:04 +02:00
|
|
|
|
2020-06-13 00:44:56 +02:00
|
|
|
let mut cargo = builder.cargo(
|
|
|
|
compiler,
|
|
|
|
Mode::Rustc,
|
|
|
|
SourceType::InTree,
|
|
|
|
target,
|
|
|
|
cargo_subcommand(builder.kind),
|
|
|
|
);
|
2019-10-22 17:51:35 +02:00
|
|
|
rustc_cargo(builder, &mut cargo, target);
|
2020-10-03 01:51:36 +02:00
|
|
|
if let Subcommand::Check { all_targets: true, .. } = builder.config.cmd {
|
|
|
|
cargo.arg("--all-targets");
|
|
|
|
}
|
2020-09-02 22:41:36 +02:00
|
|
|
|
|
|
|
// Explicitly pass -p for all compiler krates -- this will force cargo
|
|
|
|
// to also check the tests/benches/examples for these crates, rather
|
|
|
|
// than just the leaf crate.
|
2020-10-25 13:13:14 +01:00
|
|
|
for krate in builder.in_tree_crates("rustc-main", Some(target)) {
|
2020-09-02 22:41:36 +02:00
|
|
|
cargo.arg("-p").arg(krate.name);
|
|
|
|
}
|
2018-03-16 16:35:03 +01:00
|
|
|
|
2021-01-16 04:34:00 +01:00
|
|
|
builder.info(&format!(
|
|
|
|
"Checking stage{} compiler artifacts ({} -> {})",
|
|
|
|
builder.top_stage, &compiler.host, target
|
|
|
|
));
|
2019-12-22 23:42:04 +01:00
|
|
|
run_cargo(
|
|
|
|
builder,
|
|
|
|
cargo,
|
2020-09-30 02:24:14 +02:00
|
|
|
args(builder),
|
2019-12-22 23:42:04 +01:00
|
|
|
&librustc_stamp(builder, compiler, target),
|
|
|
|
vec![],
|
|
|
|
true,
|
|
|
|
);
|
2018-03-16 16:35:03 +01:00
|
|
|
|
2018-01-15 18:44:00 +01:00
|
|
|
let libdir = builder.sysroot_libdir(compiler, target);
|
2018-12-02 21:47:41 +01:00
|
|
|
let hostdir = builder.sysroot_libdir(compiler, compiler.host);
|
|
|
|
add_to_sysroot(&builder, &libdir, &hostdir, &librustc_stamp(builder, compiler, target));
|
2018-01-15 18:44:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-15 14:23:43 +02:00
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
|
|
|
pub struct CodegenBackend {
|
|
|
|
pub target: TargetSelection,
|
|
|
|
pub backend: Interned<String>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Step for CodegenBackend {
|
|
|
|
type Output = ();
|
|
|
|
const ONLY_HOSTS: bool = true;
|
|
|
|
const DEFAULT: bool = true;
|
|
|
|
|
|
|
|
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
|
|
|
run.paths(&["compiler/rustc_codegen_cranelift", "rustc_codegen_cranelift"])
|
|
|
|
}
|
|
|
|
|
|
|
|
fn make_run(run: RunConfig<'_>) {
|
|
|
|
for &backend in &[INTERNER.intern_str("cranelift")] {
|
|
|
|
run.builder.ensure(CodegenBackend { target: run.target, backend });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn run(self, builder: &Builder<'_>) {
|
2021-01-16 03:43:23 +01:00
|
|
|
let compiler = builder.compiler(builder.top_stage, builder.config.build);
|
2020-10-15 14:23:43 +02:00
|
|
|
let target = self.target;
|
|
|
|
let backend = self.backend;
|
|
|
|
|
|
|
|
builder.ensure(Rustc { target });
|
|
|
|
|
|
|
|
let mut cargo = builder.cargo(
|
|
|
|
compiler,
|
|
|
|
Mode::Codegen,
|
|
|
|
SourceType::Submodule,
|
|
|
|
target,
|
|
|
|
cargo_subcommand(builder.kind),
|
|
|
|
);
|
|
|
|
cargo
|
|
|
|
.arg("--manifest-path")
|
|
|
|
.arg(builder.src.join(format!("compiler/rustc_codegen_{}/Cargo.toml", backend)));
|
|
|
|
rustc_cargo_env(builder, &mut cargo, target);
|
|
|
|
|
2020-11-14 23:35:50 +01:00
|
|
|
builder.info(&format!(
|
2021-01-16 04:34:00 +01:00
|
|
|
"Checking stage{} {} artifacts ({} -> {})",
|
|
|
|
builder.top_stage, backend, &compiler.host.triple, target.triple
|
2020-11-14 23:35:50 +01:00
|
|
|
));
|
|
|
|
|
2020-10-15 14:23:43 +02:00
|
|
|
run_cargo(
|
|
|
|
builder,
|
|
|
|
cargo,
|
2020-09-30 02:24:14 +02:00
|
|
|
args(builder),
|
2020-10-15 14:23:43 +02:00
|
|
|
&codegen_backend_stamp(builder, compiler, target, backend),
|
|
|
|
vec![],
|
|
|
|
true,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-01 15:57:48 +02:00
|
|
|
macro_rules! tool_check_step {
|
2020-06-13 00:44:56 +02:00
|
|
|
($name:ident, $path:expr, $source_type:expr) => {
|
2020-04-01 15:57:48 +02:00
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
|
|
|
pub struct $name {
|
2020-07-17 16:08:04 +02:00
|
|
|
pub target: TargetSelection,
|
2020-04-01 15:57:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Step for $name {
|
|
|
|
type Output = ();
|
|
|
|
const ONLY_HOSTS: bool = true;
|
|
|
|
const DEFAULT: bool = true;
|
|
|
|
|
|
|
|
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
|
|
|
run.path($path)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn make_run(run: RunConfig<'_>) {
|
|
|
|
run.builder.ensure($name { target: run.target });
|
|
|
|
}
|
|
|
|
|
|
|
|
fn run(self, builder: &Builder<'_>) {
|
2021-01-16 03:43:23 +01:00
|
|
|
let compiler = builder.compiler(builder.top_stage, builder.config.build);
|
2020-04-01 15:57:48 +02:00
|
|
|
let target = self.target;
|
|
|
|
|
|
|
|
builder.ensure(Rustc { target });
|
|
|
|
|
2020-09-02 22:41:36 +02:00
|
|
|
let mut cargo = prepare_tool_cargo(
|
2020-04-01 15:57:48 +02:00
|
|
|
builder,
|
|
|
|
compiler,
|
|
|
|
Mode::ToolRustc,
|
|
|
|
target,
|
|
|
|
cargo_subcommand(builder.kind),
|
|
|
|
$path,
|
2020-06-13 00:44:56 +02:00
|
|
|
$source_type,
|
2020-04-01 15:57:48 +02:00
|
|
|
&[],
|
|
|
|
);
|
|
|
|
|
2020-10-03 01:51:36 +02:00
|
|
|
if let Subcommand::Check { all_targets: true, .. } = builder.config.cmd {
|
|
|
|
cargo.arg("--all-targets");
|
|
|
|
}
|
2020-09-02 22:41:36 +02:00
|
|
|
|
2021-01-22 04:51:58 +01:00
|
|
|
// Enable internal lints for clippy and rustdoc
|
|
|
|
// NOTE: this intentionally doesn't enable lints for any other tools,
|
|
|
|
// see https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776
|
|
|
|
if $path == "src/tools/rustdoc" || $path == "src/tools/clippy" {
|
|
|
|
cargo.rustflag("-Zunstable-options");
|
|
|
|
}
|
|
|
|
|
2020-09-02 22:00:47 +02:00
|
|
|
builder.info(&format!(
|
2021-01-16 04:34:00 +01:00
|
|
|
"Checking stage{} {} artifacts ({} -> {})",
|
|
|
|
builder.top_stage,
|
2020-04-01 15:57:48 +02:00
|
|
|
stringify!($name).to_lowercase(),
|
2020-07-17 16:08:04 +02:00
|
|
|
&compiler.host.triple,
|
|
|
|
target.triple
|
2020-09-02 22:00:47 +02:00
|
|
|
));
|
2020-04-01 15:57:48 +02:00
|
|
|
run_cargo(
|
|
|
|
builder,
|
|
|
|
cargo,
|
2020-09-30 02:24:14 +02:00
|
|
|
args(builder),
|
2020-04-01 15:57:48 +02:00
|
|
|
&stamp(builder, compiler, target),
|
|
|
|
vec![],
|
|
|
|
true,
|
|
|
|
);
|
|
|
|
|
|
|
|
let libdir = builder.sysroot_libdir(compiler, target);
|
|
|
|
let hostdir = builder.sysroot_libdir(compiler, compiler.host);
|
|
|
|
add_to_sysroot(&builder, &libdir, &hostdir, &stamp(builder, compiler, target));
|
|
|
|
|
|
|
|
/// Cargo's output path in a given stage, compiled by a particular
|
|
|
|
/// compiler for the specified target.
|
|
|
|
fn stamp(
|
|
|
|
builder: &Builder<'_>,
|
|
|
|
compiler: Compiler,
|
2020-07-17 16:08:04 +02:00
|
|
|
target: TargetSelection,
|
2020-04-01 15:57:48 +02:00
|
|
|
) -> PathBuf {
|
|
|
|
builder
|
|
|
|
.cargo_out(compiler, Mode::ToolRustc, target)
|
|
|
|
.join(format!(".{}-check.stamp", stringify!($name).to_lowercase()))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2018-04-18 20:46:58 +02:00
|
|
|
}
|
|
|
|
|
2020-06-13 00:44:56 +02:00
|
|
|
tool_check_step!(Rustdoc, "src/tools/rustdoc", SourceType::InTree);
|
|
|
|
// Clippy is a hybrid. It is an external tool, but uses a git subtree instead
|
|
|
|
// of a submodule. Since the SourceType only drives the deny-warnings
|
|
|
|
// behavior, treat it as in-tree so that any new warnings in clippy will be
|
|
|
|
// rejected.
|
|
|
|
tool_check_step!(Clippy, "src/tools/clippy", SourceType::InTree);
|
2018-04-18 20:46:58 +02:00
|
|
|
|
2020-09-02 22:41:36 +02:00
|
|
|
tool_check_step!(Bootstrap, "src/bootstrap", SourceType::InTree);
|
|
|
|
|
2018-01-15 18:44:00 +01:00
|
|
|
/// Cargo's output path for the standard library in a given stage, compiled
|
|
|
|
/// by a particular compiler for the specified target.
|
2020-07-17 16:08:04 +02:00
|
|
|
fn libstd_stamp(builder: &Builder<'_>, compiler: Compiler, target: TargetSelection) -> PathBuf {
|
2018-05-19 22:04:41 +02:00
|
|
|
builder.cargo_out(compiler, Mode::Std, target).join(".libstd-check.stamp")
|
2018-01-15 18:44:00 +01:00
|
|
|
}
|
|
|
|
|
2020-09-02 22:41:36 +02:00
|
|
|
/// Cargo's output path for the standard library in a given stage, compiled
|
|
|
|
/// by a particular compiler for the specified target.
|
|
|
|
fn libstd_test_stamp(
|
|
|
|
builder: &Builder<'_>,
|
|
|
|
compiler: Compiler,
|
|
|
|
target: TargetSelection,
|
|
|
|
) -> PathBuf {
|
|
|
|
builder.cargo_out(compiler, Mode::Std, target).join(".libstd-check-test.stamp")
|
|
|
|
}
|
|
|
|
|
2018-01-15 18:44:00 +01:00
|
|
|
/// Cargo's output path for librustc in a given stage, compiled by a particular
|
|
|
|
/// compiler for the specified target.
|
2020-07-17 16:08:04 +02:00
|
|
|
fn librustc_stamp(builder: &Builder<'_>, compiler: Compiler, target: TargetSelection) -> PathBuf {
|
2018-05-19 22:04:41 +02:00
|
|
|
builder.cargo_out(compiler, Mode::Rustc, target).join(".librustc-check.stamp")
|
2018-01-15 18:44:00 +01:00
|
|
|
}
|
2020-10-15 14:23:43 +02:00
|
|
|
|
|
|
|
/// Cargo's output path for librustc_codegen_llvm in a given stage, compiled by a particular
|
|
|
|
/// compiler for the specified target and backend.
|
|
|
|
fn codegen_backend_stamp(
|
|
|
|
builder: &Builder<'_>,
|
|
|
|
compiler: Compiler,
|
|
|
|
target: TargetSelection,
|
|
|
|
backend: Interned<String>,
|
|
|
|
) -> PathBuf {
|
|
|
|
builder
|
|
|
|
.cargo_out(compiler, Mode::Codegen, target)
|
|
|
|
.join(format!(".librustc_codegen_{}-check.stamp", backend))
|
|
|
|
}
|