diff options
| author | kennytm <kennytm@gmail.com> | 2017-11-20 01:40:02 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2017-11-22 04:11:02 +0800 |
| commit | 8cc5cd4faa636e07979a8161dbad009eadf1e667 (patch) | |
| tree | 122a538205bee2f7570a66b783b6914182b39162 /src/bootstrap | |
| parent | 63739ab7b210c1a8c890c2ea5238a3284877daa3 (diff) | |
| download | rust-8cc5cd4faa636e07979a8161dbad009eadf1e667.tar.gz rust-8cc5cd4faa636e07979a8161dbad009eadf1e667.zip | |
Always ignore build failure of failable tools (rls, rustfmt, clippy, miri).
If build failed for these tools, they will be automatically skipped from distribution, and will not fail the whole build. Test failures are *not* ignored, nor build failure of other tools (e.g. cargo). Therefore it should have no observable effect to the current CI system. This is step 1/8 of automatic management of broken tools #45861.
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/dist.rs | 8 | ||||
| -rw-r--r-- | src/bootstrap/tool.rs | 11 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 95be9a396c1..bfe2a64f5ba 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -1083,7 +1083,8 @@ impl Step for Rls { let rls = builder.ensure(tool::Rls { compiler: builder.compiler(stage, build.build), target - }).expect("Rls to build: toolstate is testing"); + }).or_else(|| { println!("Unable to build RLS, skipping dist"); None })?; + install(&rls, &image.join("bin"), 0o755); let doc = image.join("share/doc/rls"); install(&src.join("README.md"), &doc, 0o644); @@ -1167,11 +1168,12 @@ impl Step for Rustfmt { let rustfmt = builder.ensure(tool::Rustfmt { compiler: builder.compiler(stage, build.build), target - }).expect("Rustfmt to build: toolstate is testing"); + }).or_else(|| { println!("Unable to build Rustfmt, skipping dist"); None })?; let cargofmt = builder.ensure(tool::Cargofmt { compiler: builder.compiler(stage, build.build), target - }).expect("Cargofmt to build: toolstate is testing"); + }).or_else(|| { println!("Unable to build Cargofmt, skipping dist"); None })?; + install(&rustfmt, &image.join("bin"), 0o755); install(&cargofmt, &image.join("bin"), 0o755); let doc = image.join("share/doc/rustfmt"); diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index 9b16ca0980a..fe1c8292340 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -11,7 +11,7 @@ use std::fs; use std::env; use std::path::PathBuf; -use std::process::Command; +use std::process::{Command, exit}; use Mode; use Compiler; @@ -115,7 +115,14 @@ impl Step for ToolBuild { println!("Building stage{} tool {} ({})", compiler.stage, tool, target); let mut cargo = prepare_tool_cargo(builder, compiler, target, "build", path); - build.run_expecting(&mut cargo, expectation); + if !build.try_run(&mut cargo, expectation) { + if expectation == BuildExpectation::None { + exit(1); + } else { + return None; + } + } + if expectation == BuildExpectation::Succeeding || expectation == BuildExpectation::None { let cargo_out = build.cargo_out(compiler, Mode::Tool, target) .join(exe(tool, &compiler.host)); |
