-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of patch
in Cargo.toml
to override dependency requires .cargo/registry
to be cleared when patch
removed.
#11778
Comments
patch
in Cargo.toml
to override dependency requires .cargo/registry
clear when removed.patch
in Cargo.toml
to override dependency requires .cargo/registry
to be cleared when patch
removed.
Hm, that's strange. Can you provide more information about what made it appear that it was still using the patch? Can you provide a basic reproduction? For example, the following seems to work for me:
|
Yeah I just don't have the time to push this right now. There could be any number of additional factors contributing to this, which I can't take the time to isolate:
I did encounter this problem and it was pretty subtle and bothersome so I thought it worth noting. I'll bump this If I can recreate more exactly, but I can't contribute more currently. You can close if you like. |
Thanks for the report. Going to close this for now due to inactivity. If you have time to investigate and provide a minimal reproduction, feel free to open a new issue :) |
Hey there, just had this happen to me I patched I ran Using We are also in a workspace but only have one Cargo.lock, and I never merged my wasm patch, so on our main, We don't depend on Maybe the transitive dependency confused it. We do have cross-compiling set up for some crates, but in this case I was just running Would it help if I made a reproduction repo? With say, 2 different Rust projects and a Bash script with commented-out commands like this:
It would take a few hours so I don't want to start now but I could probably do it. |
@ReactorScram thanks for the detailed write-up! It would be appreciated if you could share a minimal reproduction. |
I couldn't figure it out. It must be some strange combination of factors. Stuff from crates.io gets cached in |
Would it be that like IDE tool messed this up? The checked out sources are not readonly #9455. |
Possibly. I may have had VS Code open while this was all happening, and it has rust-analyzer on |
Problem
Got into a very confusing situation whereby I
patch
ed in a crate for local development and then removed thepatch
, and went several days with the patched version of the crate still present in my.cargo/registry
.I would think that when a
patch
statement is removed, the relevantregistry
entry should be removed and re-cached.Our current workaround is to remove the entire Cargo cash via:
Steps
patch
statement in yourCargo.toml
Build and develop. You should now be using the patched version of the crate.
Remove the
patch
statement from yourCargo.toml
The bug should be present, in that you should still be building using the patched version of your crate when you no longer should.
A manual deletion of the Cargo
registry
should be necessary to correct this.Possible Solution(s)
No response
Notes
No response
Version
No response
The text was updated successfully, but these errors were encountered: