about summary refs log tree commit diff
path: root/src/bootstrap/tool.rs
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2017-11-30 18:18:47 +0800
committerkennytm <kennytm@gmail.com>2017-12-03 18:36:56 +0800
commit971b1ba42bcb318baf31047cf80a4cf532756ec8 (patch)
tree067132d0ba595ab165b52c608f6567469c625792 /src/bootstrap/tool.rs
parent128199e39c2644e3e0c0580869a561f9211e6d98 (diff)
downloadrust-971b1ba42bcb318baf31047cf80a4cf532756ec8.tar.gz
rust-971b1ba42bcb318baf31047cf80a4cf532756ec8.zip
Record build and test result of extended tools into toolstates.json.
Diffstat (limited to 'src/bootstrap/tool.rs')
-rw-r--r--src/bootstrap/tool.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index fe1c8292340..fa9bdc43c37 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -115,7 +115,19 @@ impl Step for ToolBuild {
         println!("Building stage{} tool {} ({})", compiler.stage, tool, target);
 
         let mut cargo = prepare_tool_cargo(builder, compiler, target, "build", path);
-        if !build.try_run(&mut cargo, expectation) {
+        let is_expected = build.try_run(&mut cargo, expectation);
+        // If the expectation is "Failing", `try_run` returning true actually
+        // means a build-failure is successfully observed, i.e. the tool is
+        // broken. Thus the XOR here.
+        // Sorry for the complicated logic, but we can remove this expectation
+        // logic after #45861 is fully fixed.
+        build.save_toolstate(tool, if is_expected ^ (expectation == BuildExpectation::Failing) {
+            ToolState::Compiling
+        } else {
+            ToolState::Broken
+        });
+
+        if !is_expected {
             if expectation == BuildExpectation::None {
                 exit(1);
             } else {