最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

rust - Propagating features in workspace doesn't work - Stack Overflow

programmeradmin4浏览0评论

I am stuck with the following problem. I have a workspace containing several crates anized like this:

Top level Cargo.toml:

[workspace]
members = [
"molar",
"molar_python", 
...
...
]

The crate molar has a feature gromacs, which turns on conditional compilation in several places and activates another dependency.

molar/Cargo.toml:

[features]
gromacs = ["dep:molar_gromacs"]

Now, when I'm compiling molar_python, which depends on molar, I want to propagate gromacs feature down to molar like this:

molar_python/Cargo.toml:

[dependencies]    
molar = {version = "0.8.0", path = "../molar", default-features = false}
...
[features]
gromacs = ["molar/gromacs"]

The idea is that when I do cargo build -p molar_python --features=gromacs the feature is propagated to molar crate and switches on the same feature there. At least it should work like this according to the manual. However, it doesn't work at all. Whatever I do I can't activate gromacs feature in molar crate indirectly from molar_python. The only way is to explicitly switch it on in the crate itself.

Am I missing something obvious? What is the correct way of doing this?

This happens in my molar crate.

发布评论

评论列表(0)

  1. 暂无评论