cargo icon indicating copy to clipboard operation
cargo copied to clipboard

Unnecessary index fetching upon patching two dependencies with same package name

Open ldm0 opened this issue 1 year ago • 2 comments

Problem

If you have two patches on two dependencies with same package name, you will see Updating crates.io index every time you run cargo check. The index update is unnecessary and slows down development speed.

Steps

Simple reproduction repo: https://github.com/ldm0/cargo-bug-repo/tree/31fb297e58ffa3be877062940a300883d2cb580a

  1. Run cargo check
  2. Run cargo check (you will still see Updating crates.io index)

Possible Solution(s)

I'll file a fix PR later.

Notes

No response

Version

Can't find a cargo version which doesn't have this issue.

ldm0 avatar May 04 '24 23:05 ldm0

Sounds like this is a duplicate of #13405. Is that right?

epage avatar May 06 '24 03:05 epage

Yeah, the root cause is the same. Bug behaviour differs though.

ldm0 avatar May 06 '24 04:05 ldm0

Since https://github.com/rust-lang/cargo/pull/13572 is merged, I'll go ahead and close this as resolved. Let us know if things are still wrong. Thank you.

weihanglo avatar May 19 '24 14:05 weihanglo