Skip to content

Commit 5d67261

Browse files
committed
Auto merge of #1130 - mati865:master, r=Diggsey
Increase Rust detection timeout to 3 seconds Fixes #1118 With 3 seconds timeout cold start isn't issue anymore. To simulate cold start use: ``` sync ; echo 3 | sudo tee /proc/sys/vm/drop_caches rustup update ```
2 parents 6d3d46b + b8a0dda commit 5d67261

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rustup-cli/common.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ pub fn rustc_version(toolchain: &Toolchain) -> String {
235235
// we guard against such cases by enforcing a reasonable timeout to read.
236236
let mut line1 = None;
237237
if let Ok(mut child) = cmd.spawn() {
238-
let timeout = Duration::new(1, 0);
238+
let timeout = Duration::new(3, 0);
239239
match child.wait_timeout(timeout) {
240240
Ok(Some(status)) if status.success() => {
241241
let out = child.stdout.expect("Child::stdout requested but not present");
@@ -248,6 +248,7 @@ pub fn rustc_version(toolchain: &Toolchain) -> String {
248248
}
249249
Ok(None) => {
250250
let _ = child.kill();
251+
return String::from("(timeout reading rustc version)")
251252
}
252253
Ok(Some(_)) | Err(_) => {}
253254
}

0 commit comments

Comments
 (0)