You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.
Apparently the backtrace-sys dependency is always compiled, regardless of whether the backtrace feature is present. This bit me because when compiling for the x86_64-unknown-linux-musl target and the musl C library isn't installed, backtrace-sys can't be compiled.
My question is, why is error-chain depending on backtrace-sys even when the backtrace feature isn't activated?
This is roughly what I was doing to replicate a failed travis build for my mdbook PR, azerupi/mdbook#361.
$ rustup target add x86_64-unknown-linux-musl
$ cargo build --target x86_64-unknown-linux-musl
Compiling rustc-demangle v0.1.4
Compiling backtrace-sys v0.1.11
error: failed to run custom build command for `backtrace-sys v0.1.11`
...
--- stderr
configure: error: in `/home/michael/Documents/forks/mdBook/target/x86_64-unknown-linux-musl/debug/build/backtrace-sys-9b035f64636a9441/out':
configure: error: C compiler cannot create executables
I then thought I could work around this by telling error-chain to not use the backtrace feature. With the backtrace feature removed this shouldn't try to compile anything related to backtraces.
// Cargo.toml
- error-chain = "0.10.0"+ error-chain = { version = "0.10.0", features = [] }
Recompiling then gives you the same error.
The build succeeds if you install musl gcc wrapper (pacman -S musl), but that means you are still building the backtrace-sys crate even when the backtrace feature isn't enabled.
The text was updated successfully, but these errors were encountered:
I tried that too and it still compiles backtrace-sys regardless of whether I specify default-features = false and/or features = [].
error-chain declares backtrace as an optional dependency which is only meant to be compiled when the backtrace feature is enabled, do you know why cargo would still be compiling an optional dependency even when it is told not to?
Apparently the
backtrace-sys
dependency is always compiled, regardless of whether thebacktrace
feature is present. This bit me because when compiling for thex86_64-unknown-linux-musl
target and the musl C library isn't installed,backtrace-sys
can't be compiled.My question is, why is
error-chain
depending onbacktrace-sys
even when thebacktrace
feature isn't activated?This is roughly what I was doing to replicate a failed travis build for my
mdbook
PR, azerupi/mdbook#361.I then thought I could work around this by telling
error-chain
to not use thebacktrace
feature. With thebacktrace
feature removed this shouldn't try to compile anything related to backtraces.Recompiling then gives you the same error.
The build succeeds if you install musl gcc wrapper (
pacman -S musl
), but that means you are still building thebacktrace-sys
crate even when thebacktrace
feature isn't enabled.The text was updated successfully, but these errors were encountered: