Skip to content

Configuration specific dependencies break cargo tree #13854

Closed
@abrisco

Description

@abrisco

Problem

Running cargo tree on the following yaml now fails in Nightly releases of Cargo

[package]
name = "target_cfg_features"
version = "0.1.0"
edition = "2018"

# Required to satisfy cargo but no `lib.rs` is expected to
# exist within test data.
[lib]
path = "lib.rs"

[dependencies]
tokio = "1.25.0"

[target.'cfg(unix)'.dependencies.tokio]
features = ["fs"]

Stable

target_cfg_features v0.1.0 (/target_cfg_features)
└── tokio v1.25.0
    └── pin-project-lite v0.2.9
    [build-dependencies]
    └── autocfg v1.1.0

Nightly

error: failed to parse manifest at `/target_cfg_features/Cargo.toml`

Caused by:
  dependency (tokio) specified without providing a local path, Git repository, version, or workspace dependency to use

Steps

Use Cargo.toml from above and run cargo tree

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.78.0 (54d8815d0 2024-03-26)
cargo 1.80.0-nightly (6087566b3 2024-04-30)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugS-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions