about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2021-01-29 17:04:31 +0000
committerJoshua Nelson <jyn514@gmail.com>2021-01-29 17:04:31 +0000
commit807b5f5591e5c726e7965c0d5ff308b0dc1e874f (patch)
tree5aec76196014f68c50c30c19cc28a60b099c9605
parentb122908617436af187252572ed5db96850551380 (diff)
downloadrust-807b5f5591e5c726e7965c0d5ff308b0dc1e874f.tar.gz
rust-807b5f5591e5c726e7965c0d5ff308b0dc1e874f.zip
Don't print error output from rustup when detecting default build triple
Before, it could print this error if no toolchain was configured:

```
error: no default toolchain configured
error: backtrace:
error: stack backtrace:
   0: error_chain::backtrace::imp::InternalBacktrace::new
   1: rustup::config::Cfg::toolchain_for_dir
   2: rustup_init::run_rustup_inner
   3: rustup_init::main
   4: std::rt::lang_start::{{closure}}
   5: main
   6: __libc_start_main
   7: _start
```
-rw-r--r--src/bootstrap/bootstrap.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 8576f57959a..5b0b89cc2db 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -194,7 +194,8 @@ def default_build_triple(verbose):
     # being detected as GNU instead of MSVC.
     default_encoding = sys.getdefaultencoding()
     try:
-        version = subprocess.check_output(["rustc", "--version", "--verbose"])
+        version = subprocess.check_output(["rustc", "--version", "--verbose"],
+                stderr=subprocess.DEVNULL)
         version = version.decode(default_encoding)
         host = next(x for x in version.split('\n') if x.startswith("host: "))
         triple = host.split("host: ")[1]