Provide better diagnostics when patching fails
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
There is one particular case I keep hitting that's a papercut for me. Servo uses a mixture of git and crates.io dependencies, and sometimes we end up switching between the two so it's easy to forget the true source of a dependency. When adding a patch, we either need a [patch.crates-io] or [patch."https://github.com/servo/whatever"]. When I get this wrong, however, all I get is a message from Cargo that says that the patch was ignored. It seems like it should be possible for Cargo to notice when a patch matches the name of an existing dependency, check whether the patch source differs from the dependency's source and provide a better error message in that case.
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 tracing Cargo's patch resolution and the diagnostic path that reports an ignored patch. Reproduce the mismatch between a dependency source and a patch source, then verify that the resulting message explains which patch section is required and why the patch was ignored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100