-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo vendor modifies the package cache without locking #12254
Comments
I think your observation is correct. This line does delete sources from cargo glocal package source cache. Line 138 in 928b956
I think the suggested approach is pretty much doable, and my impression is that during the dependency resolution triage: @rustbot label +C-bug +Command-vendor +S-accepted +E-easy |
@rustbot claim |
I don't think Also we specifically don't want to acquire the package lock for I think the best way forward might be to just revert alexcrichton/cargo-vendor#131. |
|
Only for dependency resolution and downloading crates, not during the actual build itself. However it still needs to read the crate source code from the package cache during the build. |
That's what I was saying.
The bad news is that |
Currently we only have a single way to acquire the package cache lock: |
This turns out to be more complicated than I expected: the package cache lock is a recursive lock and OSes don't like it when you acquire both a read and write lock on the same file. I still think the best way forward is to revert alexcrichton/cargo-vendor#131: we should never be modifying code for extracted crates. |
I personally like this idea. However I was not there and have no idea what would happen after doing so. Let's label this as @rustbot label +S-needs-design +E-medium -S-accepted -E-easy |
I think if we revert it then we would have this kind of issue again. #5956 But I also agree with |
We are getting occasional, but infrequent, failures in our CI which uses
cargo vendor
. Looking into it, it seems that this could be due to alexcrichton/cargo-vendor#131, wherecargo vendor
will delete downloaded crates in the package cache, even though those crates could be concurrently used by other build processes.This is done without holding the package cache lock, but even if it did I'm not sure this is correct since other cargo commands will read from the package cache (e.g.
cargo build
will read the code from extracted crates) without holding the package cache lock.The text was updated successfully, but these errors were encountered: