true
}
-fn try_run_quiet(build: &Build, cmd: &mut Command) {
+fn try_run_quiet(build: &Build, cmd: &mut Command) -> bool {
if !build.fail_fast {
if !build.try_run_quiet(cmd) {
let mut failures = build.delayed_failures.borrow_mut();
failures.push(format!("{:?}", cmd));
+ return false;
}
} else {
build.run_quiet(cmd);
}
+ true
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
}
#[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);
if !build.config.vendor {
cmd.arg("--no-vendor");
}
}
fn make_run(run: RunConfig) {
- run.builder.ensure(Tidy {
- host: run.builder.build.build,
- });
+ run.builder.ensure(Tidy);
}
}
}
if build.config.llvm_enabled {
- let llvm_config = build.llvm_config(target);
+ let llvm_config = build.llvm_config(build.config.build);
let llvm_version = output(Command::new(&llvm_config).arg("--version"));
cmd.arg("--llvm-version").arg(llvm_version);
if !build.is_rust_llvm(target) {
continue;
}
- markdown_test(builder, compiler, &p);
+ let test_result = markdown_test(builder, compiler, &p);
+ if self.is_ext_doc {
+ let toolstate = if test_result {
+ ToolState::TestPass
+ } else {
+ ToolState::TestFail
+ };
+ build.save_toolstate(self.name, toolstate);
+ }
}
}
}
}
}
-fn markdown_test(builder: &Builder, compiler: Compiler, markdown: &Path) {
+fn markdown_test(builder: &Builder, compiler: Compiler, markdown: &Path) -> bool {
let build = builder.build;
let mut file = t!(File::open(markdown));
let mut contents = String::new();
t!(file.read_to_string(&mut contents));
if !contents.contains("```") {
- return;
+ return true;
}
println!("doc tests for: {}", markdown.display());
cmd.arg("--test-args").arg(test_args);
if build.config.quiet_tests {
- try_run_quiet(build, &mut cmd);
+ try_run_quiet(build, &mut cmd)
} else {
- try_run(build, &mut cmd);
+ try_run(build, &mut cmd)
}
}
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) {