/// Run this rule for all hosts without cross compiling.
const ONLY_HOSTS: bool = false;
- /// Only run this step with the build triple as host and target.
- const ONLY_BUILD: bool = false;
-
/// Primary function to execute this rule. Can call `builder.ensure(...)`
/// with other steps to run those.
fn run(self, builder: &Builder) -> Self::Output;
struct StepDescription {
default: bool,
only_hosts: bool,
- only_build: bool,
should_run: fn(ShouldRun) -> ShouldRun,
make_run: fn(RunConfig),
name: &'static str,
StepDescription {
default: S::DEFAULT,
only_hosts: S::ONLY_HOSTS,
- only_build: S::ONLY_BUILD,
should_run: S::should_run,
make_run: S::make_run,
name: unsafe { ::std::intrinsics::type_name::<S>() },
self.name, builder.config.exclude);
}
let build = builder.build;
- let hosts = if self.only_build {
- build.build_triple()
- } else {
- &build.hosts
- };
+ let hosts = &build.hosts;
// Determine the targets participating in this rule.
let targets = if self.only_hosts {
if build.config.run_host_only {
&[]
- } else if self.only_build {
- build.build_triple()
} else {
&build.hosts
}
});
install_analysis(builder, self.stage, self.target);
};
- Src, "src", Self::should_build(_config) , only_hosts: true, {
- builder.ensure(dist::Src);
- install_src(builder, self.stage);
- }, ONLY_BUILD;
Rustc, "src/librustc", true, only_hosts: true, {
builder.ensure(dist::Rustc {
compiler: builder.compiler(self.stage, self.target),
install_rustc(builder, self.stage, self.target);
};
);
+
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct Src {
+ pub stage: u32,
+}
+
+impl Step for Src {
+ type Output = ();
+ const DEFAULT: bool = true;
+ const ONLY_HOSTS: bool = true;
+
+ fn should_run(run: ShouldRun) -> ShouldRun {
+ let config = &run.builder.config;
+ let cond = config.extended &&
+ config.tools.as_ref().map_or(true, |t| t.contains("src"));
+ run.path("src").default_condition(cond)
+ }
+
+ fn make_run(run: RunConfig) {
+ run.builder.ensure(Src {
+ stage: run.builder.top_stage,
+ });
+ }
+
+ fn run(self, builder: &Builder) {
+ builder.ensure(dist::Src);
+ install_src(builder, self.stage);
+ }
+}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
-pub struct Tidy {
- host: Interned<String>,
-}
+pub struct Tidy;
impl Step for Tidy {
type Output = ();
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;
- const ONLY_BUILD: bool = true;
- /// Runs the `tidy` tool as compiled in `stage` by the `host` compiler.
+ /// Runs the `tidy` tool.
///
/// This tool in `src/tools` checks up on various bits and pieces of style and
/// otherwise just implements a few lint-like checks that are specific to the
/// compiler itself.
fn run(self, builder: &Builder) {
let build = builder.build;
- let host = self.host;
let _folder = build.fold_output(|| "tidy");
- println!("tidy check ({})", host);
+ println!("tidy check");
let mut cmd = builder.tool_cmd(Tool::Tidy);
cmd.arg(build.src.join("src"));
cmd.arg(&build.initial_cargo);
}
fn make_run(run: RunConfig) {
- run.builder.ensure(Tidy {
- host: run.builder.build.build,
- });
+ run.builder.ensure(Tidy);
}
}
impl Step for Distcheck {
type Output = ();
- const ONLY_BUILD: bool = true;
fn should_run(run: ShouldRun) -> ShouldRun {
run.path("distcheck")
type Output = ();
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;
- const ONLY_BUILD: bool = true;
/// Test the build system itself
fn run(self, builder: &Builder) {