Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
node: Do not set `RUST_BACKTRACE`
Archived lorenz opened 7 months ago

Even though it helps diagnosing panics, it should be up to the user to set RUST_BACKTRACE.

Frankly, I think it was a mistake to have radicle-node modify its own environment. We should have told the users that were seeing panics to please set RUST_BACKTRACE=1.

1 file changed +0 -8 5fea9ac0 df71a0b7
modified crates/radicle-node/src/main.rs
@@ -301,14 +301,6 @@ fn initialize_logging(options: &LogOptions) -> Result<(), Box<dyn std::error::Er
}

fn main() {
-
    // If `RUST_BACKTRACE` does not have a value, then we set it to capture
-
    // backtraces for better debugging, otherwise we keep the environments
-
    // value.
-
    const RUST_BACKTRACE: &str = "RUST_BACKTRACE";
-
    if std::env::var_os(RUST_BACKTRACE).is_none() {
-
        std::env::set_var(RUST_BACKTRACE, "1");
-
    }
-

    let options = parse_options().unwrap_or_else(|err| {
        // The lexopt errors read nicely with a comma.
        eprintln!("Failed to parse options, {err:#}");