-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Display pid of process holding lock #108107
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
@ChrisDenton I've made the necessary changes. If all's good, I'll squash my commits. |
@rustbot author |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #109097) made this pull request unmergeable. Please resolve the merge conflicts. |
src/bootstrap/bin/main.rs
Outdated
let path = config.out.join("lock"); | ||
let pid = t!(std::fs::read_to_string(&path)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to check if this path exists before reading the file. if it doesn't exist, there's no process holding the lock and this will panic because the file won't be found.
(even better than checking if it exists is to handle ErrorKind::NotFound
, to avoid TOCTOU issues.)
ping from triage - can you post your status on this PR? There hasn't been an update in a few months. Thanks! FYI: when a PR is ready for review, send a message containing |
@JohnCSimon hey! Sorry for the delay! The PR is almost done and requires just a few finishing touches. I'll get it out in the coming week😊 edit: I accidentally deleted some important binaries on my computer so do give me a couple more days to do a hard reset. |
01f3b91
to
fe7454b
Compare
I've followed up this issue at #112918 |
Fixes #107077
The PR works but does not seem the most elegant to me. Also, I'm not quite understanding why creating the build_lock using a std::fs::File::open results in an error.
More details here: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Writing.20to.20lock.20file
Happy to receive any feedback.
Thank you!
p.s. Seems like the CI is also detecting the issue I'm facing... Someone on Zulip (bjorn) has mentioned the reason behind the error. But just want to make sure I'm on the right track before continuing