So I have 3 crates with the following Cargo.toml files.
some_tests
:
[package]
name = "some_tests"
version = "0.0.0"
[features]
default = [use-std]
use-std = []
Foo:
[package]
name = "foo"
version = "0.0.0"
[dev-dependencies]
some_tests = {path = "../some_tests", default-features = false}
[features]
default = [use-std]
use-std = ["some_tests/use-std"]
And bar:
[package]
name = "bar"
version = "0.0.0"
[dependencies]
foo = {path = "../foo", default-features = false}
[features]
default = [use-std]
use-std = ["foo/use-std"]
Rationale behind such structure is that I want to be able to disable some parts of test suit which are not compatible with no_std. foo gets compiled all right, but then I try to compile bar I get the following error:
error: Package `foo v0.0.0 (file:///path/to/foo)` does not have these features: `some_tests`
As I understand problem is that dev-dependencies do not propagate to higher level crates, so then I try to compile bar cargo can't see some_tests dependency for foo thus failing to set necessary feature.
How can be this fixed or is there a better way of doing this?