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 that affects dev dependencies can't be enabled #6915

Open
dtolnay opened this issue May 7, 2019 · 0 comments
Open

Feature that affects dev dependencies can't be enabled #6915

dtolnay opened this issue May 7, 2019 · 0 comments

Comments

@dtolnay
Copy link
Member

@dtolnay dtolnay commented May 7, 2019

Problem

I have crates A, B, C with the following manifests:

[package]
name = "a"
version = "0.0.0"

[features]
f = ["b/f"]

[dependencies]
b = { path = "../b" }
[package]
name = "b"
version = "0.0.0"

[features]
f = ["c/f"]

[dev-dependencies]
c = { path = "../c" }
[package]
name = "c"
version = "0.0.0"

[features]
f = []

Expected behavior: I believe it should be possible to build crate A. Running cargo check in crate A should build crate A without feature f and crate B without feature f. Running cargo check --features f in crate A should build crate A with feature f and crate B with feature f, but not C because that is a dev dependency of a dependency.

Actual behavior: crate A cannot be built, with or without f.

$ cargo check

error: failed to select a version for `b`.
    ... required by package `a v0.0.0 (/path/to/a)`
versions that meet the requirements `= 0.0.0` are: 0.0.0

the package `a` depends on `b`, with features: `c` but `b` does not have these features.


failed to select a version for `b` which could resolve this conflict

Possible objection: "but B/f requires C/f, we can't enable B/f without building C!" I don't think this is valid because cargo check --features f in crate B will already build crate B with feature f enabled without building the dev dependency C.


Notes
cargo 1.36.0-nightly (beb8fcb 2019-04-30)

@dtolnay dtolnay added the C-bug label May 7, 2019
dtolnay referenced this issue in serde-rs/serde May 7, 2019
Without this:

    error: failed to select a version for `serde_test_suite`.
        ... required by package `serde_test_suite-tests v0.0.0`
    versions that meet the requirements `= 0.0.0` are: 0.0.0

    the package `serde_test_suite-tests` depends on `serde_test_suite`, with features: `serde` but `serde_test_suite` does not have these features.

    failed to select a version for `serde_test_suite` which could resolve this conflict

Seems like a Cargo bug -- I will minimize and report.
@ehuss ehuss added the A-features label May 8, 2019
BusyJay added a commit to tikv/grpc-rs that referenced this issue Jul 24, 2019
This PR breaks the circle dependencies between grpcio and grpcio-proto
by adding a new crate named tests and examples. We can bring things back
once rust-lang/cargo#6915 is fixed.

The new structure also fixes a problem that crates.io denies to accept
circle dependencies in dev-dependencies. More see rust-lang/cargo#4242.

This PR also updates protobuf-build to the latest version. Note that
until protobuf-build is released, we can't release grpcio-proto.
BusyJay added a commit to tikv/grpc-rs that referenced this issue Jul 24, 2019
This PR breaks the circle dependencies between grpcio and grpcio-proto
by adding a new crate named tests and examples. We can bring things back
once rust-lang/cargo#6915 is fixed.

The new structure also fixes a problem that crates.io denies to accept
circle dependencies in dev-dependencies. More see rust-lang/cargo#4242.

This PR also updates protobuf-build to the latest version.
@BusyJay BusyJay mentioned this issue Jul 24, 2019
BusyJay added a commit to tikv/grpc-rs that referenced this issue Jul 24, 2019
This PR breaks the circle dependencies between grpcio and grpcio-proto
by adding a new crate named tests and examples. We can bring things back
once rust-lang/cargo#6915 is fixed.

The new structure also fixes a problem that crates.io denies to accept
circle dependencies in dev-dependencies. More see rust-lang/cargo#4242.

This PR also updates protobuf-build to the latest version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.