Skip to content

Instantly share code, notes, and snippets.

@bahamas10
Created March 12, 2022 20:48
Show Gist options
  • Save bahamas10/497acef27b8519e824e90d9eb648a6f6 to your computer and use it in GitHub Desktop.
Save bahamas10/497acef27b8519e824e90d9eb648a6f6 to your computer and use it in GitHub Desktop.
illumos LX (void linux) rustup hangs

Rust fails to install via rustup - the process hangs when trying to download files.

Quick Fix

The simple fix is:

RUSTUP_USE_CURL=1 ./rustup-init

This will tell rustup-init to use curl instead of reqwest.

Recreation

This bug can be recreated easily with the Cargo.toml and src/main.rs files in this gist - the program will just hang.

$ RUST_LOG=trace ./target/debug/debug-rustup
[2022-03-12T20:44:34Z TRACE reqwest::blocking::wait] (ThreadId(1)) park without timeout
[2022-03-12T20:44:34Z TRACE reqwest::blocking::client] (ThreadId(2)) start runtime::block_on
[2022-03-12T20:44:34Z TRACE reqwest::blocking::wait] wait at most 10s
[2022-03-12T20:44:34Z TRACE reqwest::blocking::wait] (ThreadId(1)) park timeout 9.999995666s
[2022-03-12T20:44:34Z DEBUG reqwest::connect] starting new connection: https://www.daveeddy.com/
[2022-03-12T20:44:44Z TRACE reqwest::blocking::wait] wait timeout exceeded
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("www.daveeddy.com")), port: None, path: "/", query: None, fragment: None }, source: TimedOut }', src/main.rs:15:39
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2022-03-12T20:44:44Z TRACE reqwest::blocking::client] closing runtime thread (ThreadId(2))
[2022-03-12T20:44:44Z TRACE reqwest::blocking::client] signaled close for runtime thread (ThreadId(2))
[package]
name = "debug-rustup"
version = "0.1.0"
edition = "2021"
[dependencies]
env_logger = "0.9.0"
reqwest = { version = "0.11.9", features = ["blocking"] }
[features]
use std::time::Duration;
fn main() {
let url = "https://www.daveeddy.com";
let timeout = Duration::from_secs(10);
env_logger::init();
let client = reqwest::blocking::Client::builder()
.timeout(timeout)
.connection_verbose(true)
.build()
.unwrap();
let resp = client.get(url).send().unwrap();
println!("resp = {:?}", resp);
}
@bahamas10
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment