use std::time::{Duration, Instant};
use crate::cache::{Cache, Interned, INTERNER};
-use crate::compile;
use crate::config::{SplitDebuginfo, TargetSelection};
use crate::dist;
use crate::doc;
use crate::util::{self, add_dylib_path, add_link_lib_path, exe, libdir, output, t};
use crate::EXTRA_CHECK_CFGS;
use crate::{check, Config};
+use crate::{compile, Crate};
use crate::{Build, CLang, DocTests, GitRepo, Mode};
pub use crate::Compiler;
if paths.is_empty() || builder.config.include_default_paths {
for (desc, should_run) in v.iter().zip(&should_runs) {
if desc.default && should_run.is_really_default() {
- for pathset in &should_run.paths {
- desc.maybe_run(builder, vec![pathset.clone()]);
- }
+ desc.maybe_run(builder, should_run.paths.iter().cloned().collect());
}
}
}
eprintln!(
"note: if you are adding a new Step to bootstrap itself, make sure you register it with `describe!`"
);
- #[cfg(not(test))]
- std::process::exit(1);
- #[cfg(test)]
- // so we can use #[should_panic]
- panic!()
+ crate::detail_exit(1);
}
}
}
/// any of its (local) dependencies.
///
/// `make_run` will be called a single time with all matching command-line paths.
- pub fn krate(mut self, name: &str) -> Self {
- for krate in self.builder.in_tree_crates(name, None) {
+ pub fn crate_or_deps(self, name: &str) -> Self {
+ let crates = self.builder.in_tree_crates(name, None);
+ self.crates(crates)
+ }
+
+ /// Indicates it should run if the command-line selects any of the given crates.
+ ///
+ /// `make_run` will be called a single time with all matching command-line paths.
+ pub(crate) fn crates(mut self, crates: Vec<&Crate>) -> Self {
+ for krate in crates {
let path = krate.local_path(self.builder);
self.paths.insert(PathSet::one(path, self.kind));
}
match kind {
Kind::Build => describe!(
compile::Std,
+ compile::Rustc,
compile::Assemble,
compile::CodegenBackend,
compile::StartupObjects,
doc::RustcBook,
doc::CargoBook,
doc::Clippy,
+ doc::Miri,
doc::EmbeddedBook,
doc::EditionGuide,
),
}
pub(crate) fn download_component(&self, url: &str, dest_path: &Path, help_on_error: &str) {
+ self.verbose(&format!("download {url}"));
// Use a temporary file in case we crash while downloading, to avoid a corrupt download in cache/.
let tempfile = self.tempdir().join(dest_path.file_name().unwrap());
// While bootstrap itself only supports http and https downloads, downstream forks might
if !help_on_error.is_empty() {
eprintln!("{}", help_on_error);
}
- std::process::exit(1);
+ crate::detail_exit(1);
}
}
"error: `x.py clippy` requires a host `rustc` toolchain with the `clippy` component"
);
eprintln!("help: try `rustup component add clippy`");
- std::process::exit(1);
+ crate::detail_exit(1);
});
if !t!(std::str::from_utf8(&output.stdout)).contains("nightly") {
rustflags.arg("--cfg=bootstrap");