-
Notifications
You must be signed in to change notification settings - Fork 13.5k
rustc_trans: atomically write .rmeta outputs to avoid races. #45899
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
Conversation
Thanks for tracking this down! I'm not sure I understand what's going on here in terms of where the race is coming from though. In general I don't really trust our ability to do anything atomic on the filesystem in a cross-platform and cross-filesystem manner, so I think the best solution may be to fix this elsewhere. That being said though I also don't understand the race here, so it'd be helpful if you could explain in more detail what the race is? I'm curious why we've never seen this before because if it's just a bog-standard race it seems like we should be seeing this all over the ecosystem, so I'm not sure how #45841 is different from other setups. |
They're outputting With enough parallelism, I suspect |
Hm ok, that doesn't really make me feel good about "why isn't anyone else seeing this" but presumably |
@alexcrichton Would it be possible for us to land this fix on a provisional basis so that we can confirm this fixes the Fuchsia build? If it is not the correct fix, we need to continue debugging the issue and it'd be good to know that as soon as possible. Once it's merged (or beforehand) we can open an issue tracking possible improvements. |
@cramertj I haven't heard a response to my previous comment and AFAIK it won't be too hard to implement. That coupled with the queue generally always moving at a snail's pace I don't think will delay this much. |
I don't think there's a stable-across-filesystems semantics for the state of files while they are being written to. For example, if a machine crashes while Therefore, I'll rather use the |
Ok we can go with this for now and see how far we get. @bors: r+ To be clear I'm worried about bugs like rust-lang/cargo#800 where I realize though that this line of reasoning never really resonates with anyone and it sounds like there's not many volunteers here to put in some extra legwork. |
📌 Commit f595280 has been approved by |
⌛ Testing commit f595280 with merge 3759880e7e86ab02bc1813edc61aa29b68cfcac5... |
💔 Test failed - status-appveyor |
@bors retry
|
rustc_trans: atomically write .rmeta outputs to avoid races. Fixes #45841 in a similar vein to how LLVM writes archives: write a temporary file and then rename it. r? @alexcrichton
☀️ Test successful - status-appveyor, status-travis |
Fixes #45841 in a similar vein to how LLVM writes archives: write a temporary file and then rename it.
r? @alexcrichton