rust-lang / rust-lang/rust-analyzer
dev-dependencies on workspace member cause cyclic dependency issues
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Note: We (rust-analyzer) consider this issue resolved in terms of what we can do here.
This issue is spread across several others, so let's make one big one out of it to better track it.
https://github.com/rust-lang/rust-analyzer/issues/2414#issuecomment-561213070
Yeah, the problem is that a crate can have a dev-dep onto itself:
[package] name = "foo" version = "0.1.0" edition = "2018" [dev-dependencies] foo = { path = "." }The solution here is to start "duplicating" crates when lowering
cargo-metadaoutput toCrateGraph. In the above example, we should construct twofoocrates, one withcfg(test)and one without, and make the required depednency edge.
Issues in question:
https://github.com/rust-lang/rust-analyzer/issues/8330
https://github.com/rust-lang/rust-analyzer/issues/2414
https://github.com/rust-lang/rust-analyzer/issues/12407
https://github.com/rust-lang/rust-analyzer/issues/9574
https://github.com/rust-lang/rust-analyzer/issues/11410
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked issues 8330, 2414, 12407, 9574, and 11410, along with the referenced discussion about lowering cargo metadata to CrateGraph. The issue names no files or tests, and rust-analyzer considers its part resolved, so done cannot be defined without identifying a remaining concrete case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100