about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2020-05-22 09:50:41 -0700
committerDavid Tolnay <dtolnay@gmail.com>2020-05-22 09:51:46 -0700
commit07b1de4e9a4a223840efd60475b86f815e84acfa (patch)
treecae2563c6d3ca381add0082f7b7b3ae5a975597d
parent6a3aae8aea2448432d4fd0f7c3a22778beaab831 (diff)
downloadrust-07b1de4e9a4a223840efd60475b86f815e84acfa.tar.gz
rust-07b1de4e9a4a223840efd60475b86f815e84acfa.zip
Report error from opener in bootstrap
On my machine, an error looks like:

    Finished release [optimized] target(s) in 0.29s
    Opening doc /git/rust/build/x86_64-unknown-linux-gnu/doc/std/index.html
    command 'xdg-open (internal)' did not execute successfully; exit code: 4
    command stderr:
    gio: file:///git/rust/build/x86_64-unknown-linux-gnu/doc/std/index.html: Error when getting information for file “/git/rust/build/x86_64-unknown-linux-gnu/doc/std/index.html”: No such file or directory

    Build completed successfully in 0:00:08
-rw-r--r--src/bootstrap/doc.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs
index be5e3bfee30..5c01c5e852c 100644
--- a/src/bootstrap/doc.rs
+++ b/src/bootstrap/doc.rs
@@ -76,10 +76,10 @@ fn open(builder: &Builder<'_>, path: impl AsRef<Path>) {
     }
 
     let path = path.as_ref();
-    builder.info(&format!("Opening doc {}", path.to_string_lossy()));
-
-    // ignore error
-    let _ = opener::open(path);
+    builder.info(&format!("Opening doc {}", path.display()));
+    if let Err(err) = opener::open(path) {
+        builder.info(&format!("{}\n", err));
+    }
 }
 
 // "src/libstd" -> ["src", "libstd"]