Skip to content
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

Feature-dependent dependencies are never selected #1622

Closed
jsgf opened this issue Oct 1, 2019 · 1 comment
Closed

Feature-dependent dependencies are never selected #1622

jsgf opened this issue Oct 1, 2019 · 1 comment
Labels
C-bug Category: This is a bug.
Milestone

Comments

@jsgf
Copy link

jsgf commented Oct 1, 2019

Version

git master

Platform

all

Subcrates

  • tokio-net
  • tokio-executor

Description

tokio/Cargo.toml has:

[target.'cfg(feature = "tracing")'.dependencies]
tokio-net = { version = "=0.2.0-alpha.6", optional = true, path = "../tokio-net", features = ["tracing", "async-traits"] }
tokio-executor = { version = "=0.2.0-alpha.6", optional = true, path = "../tokio-executor", features = ["tracing"] }

According to Cargo's documentation, this does not work; the cfg(feature = "tracing") predicate will always evaluate to false. I think this only works because of the other unconditional dependency on tokio-net and tokio-executor above.

tokio-rs/tracing#365 is a related issue, and rust-lang/cargo#7442 is the Cargo issue which is mostly about lack of diagnostics for this issue.

@carllerche carllerche added the C-bug Category: This is a bug. label Oct 2, 2019
@carllerche carllerche added this to the v0.2 milestone Oct 2, 2019
@taiki-e
Copy link
Member

taiki-e commented Oct 26, 2019

Seems this was unintentionally fixed in #1680.
https://github.com/tokio-rs/tokio/pull/1680/files#diff-0a053cc4b37432b22b44e58a48f0ea81L83-L85

@taiki-e taiki-e closed this as completed Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants