-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
Lock package directory when executing Pkg commands #5628
Conversation
I think this could work, but one would want the ability to guard against a stale lock. (What if I ran |
You can remove the stale lock with Pkg.rmlock() the next time you want to do anything. This is how Arch's pacman package manager does it, it seems to work well in practice. |
True, I missed that on my first read-through. I'll shut up now. |
Not sure if it's worth putting time into this, but there are things you can do to avoid a stale lock. On *nix, Firefox uses |
@simonster that seems like quite the jump in complexity. I could work on that though it people feel it is worth it. |
Probably not worth it for now. I doubt stale locks will arise too often in practice. |
We should really use something like |
Also has the advantage of automatically being cleaned up when a process exits. |
I think |
Yeah, I don't really care which one, but we should not do this by moving files around. |
@staticfloat brought up a good point. It would be better to hold off and leverage libgit2 for this. |
Git will only prevent us from modifying the same git repository but there are Pkg-level operations that will stomp all over each other too. I think that we should lock on the REQUIRE file. |
Of course: forgot that we don't treat ~/.julia as a giant got repo anymore. Yeah, I agree. Using libuv to lock REQUIRE should work just fine.
|
bump. Sounds like we should lock the REQUIRE file using the system locks |
Depends on #7176. |
This seems like a nice-to-have, but not crucial. Does it need to be in 0.3? |
This definitely doesn't need to be in 0.3. |
6c7c7e3
to
1a4c02f
Compare
Why'd you close this, jake? |
This proposed fix was wrong, old and stale. #5628 captures the underlying problem. We will have to write this functionality ourselves as libuv has decided not support any type of file locking functionality. |
Possible fix for #5622. Write a simple lock file to the package directory when executing Pkg commands to prevent multiple instances of Pkg clobbering the same directory.