cargo-outdated
cargo-outdated copied to clipboard
dev-dependencies of dependencies specified by path are not found
Example
root/Cargo.toml:
...
[dependencies]
path-dependency = { path = "path-dependency" }
root/path-dependency/Cargo.toml:
...
[dev-dependencies]
env_logger = "*"
Running cargo outdated -v
gives:
Parsing... current workspace
Resolving... current workspace
Parsing... compat workspace
Updating... compat workspace
Updating registry `https://github.com/rust-lang/crates.io-index`
Resolving... compat workspace
Parsing... latest workspace
error: Direct dependency env_logger not found for package path-dependency
It only seems to do this if the dependency is specified by path; regular crates.io dependencies don't have this problem.
Possibly the same problem with git patched dependencies via [patch.crates-io].
This error only appears when the inner crate is not a workspace member of the outer one, i.e. adding this to root/Cargo.toml:
[workspace]
members = ["path-dependency"]
makes the error go away.