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
If you have two different dependencies that both depend on clang-sys, but dependency A uses static linking and dependency B using dynamic linking, this will fail to build.
You can test this easily with the following Cargo.toml:
[dependencies]
bindgen57 = { version = "0.57", package = "bindgen", default-features = false, features = ["static"] }
bindgen58 = { version = "0.58", package = "bindgen", default-features = false, features = ["runtime"] }
Cargo features are supposed to be additive, i.e. one crate in your dependency tree should never fail to build because another crate elsewhere in your dependency tree enables some feature.
There's also a related issue where if you do something like this:
[dependencies]
bindgen57 = { version = "0.57", package = "bindgen", default-features = false }
bindgen58 = { version = "0.58", package = "bindgen", default-features = false, features = ["runtime"] }
This will build, but it will panic at runtime:
thread 'main' panicked at 'a `libclang` shared library is not loaded on this thread', .../.cargo/registry/src/github.com-1ecc6299db9ec823/clang-sys-1.2.0/src/lib.rs:1682:1
The text was updated successfully, but these errors were encountered:
If you have two different dependencies that both depend on clang-sys, but dependency A uses static linking and dependency B using dynamic linking, this will fail to build.
You can test this easily with the following Cargo.toml:
Cargo features are supposed to be additive, i.e. one crate in your dependency tree should never fail to build because another crate elsewhere in your dependency tree enables some feature.
There's also a related issue where if you do something like this:
This will build, but it will panic at runtime:
The text was updated successfully, but these errors were encountered: