-
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
More granular locking in cargo_rustc #4282
Comments
As part of #5931, we've talked about changing the target directory layout so that there is a directory per package. This would give us more definitive units to lock. |
In #5931, we discuss having a directory per intermediate artifact inside of a user-wide cache directory. Each intermediate artifact would be lockable so there is exclusive access on the initial write and then multiple readers after that that prevent during builds. Depending on packages out of this shared location is important so we don't waste time copying things out. To keep things simple, ideally we model the target directory the same way. So in a way, fixing this issue is a perfect subset of #5931. We'd need a separate lock for the artifact directory though Any compilation that changes the fingerprint but not the Therefore, the benefit of this feature would be limited to one of
|
I think it would be good to also keep on eye on performance, since this could introduce more OS overhead. I'm also uncertain if we will run into lock limits, particularly on networked filesystems or filesystems like Docker, etc. It looks like the number of locks is configurable in Linux, but I don't immediately see any strict limits anywhere else. |
Any updates? |
Right now whenever a build happens we lock the entirety of the
target
directory for the whole build, but it may be possible for us to have a more granular locking strategy which allows multiple instances of Cargo to proceed in parallel instead of serializing them.The text was updated successfully, but these errors were encountered: