-
-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support From generation for Backtrace in stable rust #390
Comments
BTW I am willing to work on a PR to fix this, but I'd like to get some approval to fix it before I go out of my way. |
I think a feature flag to disable nightly-dependant features would be ideal here. |
ysndr
added a commit
to flox/flox
that referenced
this issue
Feb 12, 2025
With `RUST_[LIB_]BACKTRACE=1` anyhow captures backtraces to the origin of an error chain. The backtrace can then be accessed via `anyhow::Error::backtrace`, which returns a `Display`able type (`std::backtrace::Backtrace` at our version of rust). To avoid being too noisy and allow targeted enabling of backtraces, the backtrace is logged with `debug!` under the `flox::backtrace` target. Unfortunately, `thiserror` supports backtraces only when compiled with rust nightly [1][2], on account of being blocked by the stabilization of `error_generic_member_access` [3]. [1]: <dtolnay/thiserror#390> [2]: <dtolnay/thiserror#387> [3]: <rust-lang/rust#99301>
ysndr
added a commit
to flox/flox
that referenced
this issue
Feb 14, 2025
With `RUST_[LIB_]BACKTRACE=1` anyhow captures backtraces to the origin of an error chain. The backtrace can then be accessed via `anyhow::Error::backtrace`, which returns a `Display`able type (`std::backtrace::Backtrace` at our version of rust). To avoid being too noisy and allow targeted enabling of backtraces, the backtrace is logged with `debug!` under the `flox::backtrace` target. Unfortunately, `thiserror` supports backtraces only when compiled with rust nightly [1][2], on account of being blocked by the stabilization of `error_generic_member_access` [3]. [1]: <dtolnay/thiserror#390> [2]: <dtolnay/thiserror#387> [3]: <rust-lang/rust#99301>
ysndr
added a commit
to flox/flox
that referenced
this issue
Feb 14, 2025
With `RUST_[LIB_]BACKTRACE=1` anyhow captures backtraces to the origin of an error chain. The backtrace can then be accessed via `anyhow::Error::backtrace`, which returns a `Display`able type (`std::backtrace::Backtrace` at our version of rust). Unfortunately, `thiserror` supports backtraces only when compiled with rust nightly [1][2], on account of being blocked by the stabilization of `error_generic_member_access` [3]. [1]: <dtolnay/thiserror#390> [2]: <dtolnay/thiserror#387> [3]: <rust-lang/rust#99301>
ysndr
added a commit
to flox/flox
that referenced
this issue
Feb 14, 2025
With `RUST_[LIB_]BACKTRACE=1` anyhow captures backtraces to the origin of an error chain. The backtrace can then be accessed via `anyhow::Error::backtrace`, which returns a `Display`able type (`std::backtrace::Backtrace` at our version of rust). To avoid being too noisy and allow targeted enabling of backtraces, the backtrace is logged with `debug!` under the `flox::backtrace` target. Unfortunately, `thiserror` supports backtraces only when compiled with rust nightly [1][2], on account of being blocked by the stabilization of `error_generic_member_access` [3]. [1]: <dtolnay/thiserror#390> [2]: <dtolnay/thiserror#387> [3]: <rust-lang/rust#99301>
mkenigs
pushed a commit
to flox/flox
that referenced
this issue
Feb 14, 2025
With `RUST_[LIB_]BACKTRACE=1` anyhow captures backtraces to the origin of an error chain. The backtrace can then be accessed via `anyhow::Error::backtrace`, which returns a `Display`able type (`std::backtrace::Backtrace` at our version of rust). To avoid being too noisy and allow targeted enabling of backtraces, the backtrace is logged with `debug!` under the `flox::backtrace` target. Unfortunately, `thiserror` supports backtraces only when compiled with rust nightly [1][2], on account of being blocked by the stabilization of `error_generic_member_access` [3]. [1]: <dtolnay/thiserror#390> [2]: <dtolnay/thiserror#387> [3]: <rust-lang/rust#99301>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently Backtrace support has a (documented) limitation of requiring nightly rust. Presumably, this is to use
provide
API.We'd like to use
Backtrace
and#[from]
generation in stable rust, but it currently is tied to unstableerror_generic_member_access
.Backtrace
is stable since rust 1.62.0 would be nice to use it without implementing From manually and use provide api only when it is available.See #387 for more discussion
The text was updated successfully, but these errors were encountered: