dep v0.0.0 (.../crates/dep)
└── crate2 v0.0.0 (proc-macro) (.../crates/crate2)
dep v0.0.0 (.../crates/dep)
└── crate1 v0.0.0 (.../crates/crate1)
### Possible Solution(s)
_No response_
### Notes
All of this should be true for the issue to reproduce:
* `resolver = "2"`
* Either `crate1` or `crate2` is a proc macro
* `dep` has non-empty `default-features`
### Version
cargo 1.83.0-nightly (c1fa840a8 2024-08-29)
release: 1.83.0-nightly
commit-hash: c1fa840a85eca53818895901a53fae34247448b2
commit-date: 2024-08-29
host: x86_64-unknown-linux-gnu
libgit2: 1.8.1 (sys:0.19.0 vendored)
libcurl: 8.9.0-DEV (sys:0.4.74+curl-8.9.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w 11 Sep 2023
os: Arch Linux Rolling Release [64-bit]
Thanks for the report! This is working as intended. The crates are duplicated because they are being built with different features. You can view the differences with the -f "{p} {f}" flag.
Problem
Given workspace with three crates:
Where
crate1
andcrate2
usedep
identically:Then
cargo tree -d
reports duplicatedep
dependencySteps
Cargo.toml
:crates/crate1/Cargo.toml
:[dependencies] dep = { path = "../dep", default-features = false }
crates/dep/Cargo.toml
:[features] default = ["foo"] foo = []
dep v0.0.0 (.../crates/dep) └── crate2 v0.0.0 (proc-macro) (.../crates/crate2)
dep v0.0.0 (.../crates/dep) └── crate1 v0.0.0 (.../crates/crate1)