-
Notifications
You must be signed in to change notification settings - Fork 13k
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
"build directory locked" should say which process is holding the lock #107077
Comments
…, r=albertlarsan68 Print PID holding bootstrap build lock on Linux Partially address rust-lang#107077 Parse `/proc/locks` to find the PID of the process which created the build directory lock
…, r=albertlarsan68 Print PID holding bootstrap build lock on Linux Partially address rust-lang#107077 Parse `/proc/locks` to find the PID of the process which created the build directory lock
…, r=albertlarsan68 Print PID holding bootstrap build lock on Linux Partially address rust-lang#107077 Parse `/proc/locks` to find the PID of the process which created the build directory lock
@clubby789 Hi! I saw that you implemented the solution for Linux. May I know why your solution would not work for Mac/Windows? Thank you! |
Windows enthousiast here, quite sarcastic: |
Okay! Hope I'm not biting more than I can chew here but I'll give this a shot! |
There might be an existing crate that does this, I would prefer that to maintaining more platform specific code. |
Okay! Let me go source around. But if you chance upon the crate, do let me know(: |
@ChrisDenton suggests using Restart Manager on Windows (which I think is https://learn.microsoft.com/en-us/windows/win32/rstmgr/about-restart-manager ?) |
@thomcc suggests we can skip all the target specific stuff and just write the PID to the lockfile when we create it 😍 |
There is still the problem of getting the PID, this is just moving the problem elsewhere (maybe also make it simpler?) |
Moving the problem elsewhere would definitely simplify things. While it is possible to use the Windows Restart Manager for this it's not really what it's intended for (the alternative is to use undocumented APIs in a similar way to So, yeah, writing the PID to the lockfile makes sense to me. |
@jyn514 I've spent some time meddling around and I think I understand the problem but not quite the solution that is being suggested.
Thank you! |
@zephaniahong to |
ahh! Thanks! I think I get it now! And to confirm, to get the PID, I use this https://doc.rust-lang.org/stable/std/process/fn.id.html ? |
This proposal has been implemented and merged. |
Since #88310, we don't allow multiple processes of bootstrap to run in parallel. That's good to avoid issues like #76661, but means that people sometimes don't know why the build directory is locked (e.g. if they're running rust-analyzer in the background or running x in two terminals at once). We should make it easier to figure this out.
In the short-term,
ps -u $USER | grep bootstrap/debug/bootstrap
on Unix will show all the relevant processes. In the long-term, and to support windows, we might want to run the equivalent of that ourselves and directly print all relevant PIDs.The text was updated successfully, but these errors were encountered: