-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Retry opening proc-macro DLLs a few times on Windows. #107595
Retry opening proc-macro DLLs a few times on Windows. #107595
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
c39a6c2
to
227b285
Compare
@bors r+ |
What does |
…mpiler-errors Rollup of 8 pull requests Successful merges: - rust-lang#106887 (Make const/fn return params more suggestable) - rust-lang#107519 (Add type alias for raw OS errors) - rust-lang#107551 ( Replace `ConstFnMutClosure` with const closures ) - rust-lang#107595 (Retry opening proc-macro DLLs a few times on Windows.) - rust-lang#107615 (Replace nbsp in all rustdoc code blocks) - rust-lang#107621 (Intern external constraints in new solver) - rust-lang#107631 (loudly tell people when they change `Cargo.lock`) - rust-lang#107632 (Clarifying that .map() returns None if None.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
@kennykerr and I discussed this a bit. The underlying OS error is I'll continue to investigate, trying find out what exactly is underneath the |
I've seen this behavior sometimes elsewhere with Windows systems. While I never found out why, I always suspected the antivirus (or Windows Defender or whatever there is), that sees a. EXE/DLL appear from thin air and thinks it has to be checked before it is allowed to be used. |
We've been investigating this further. So far it looks like the mitigation implemented in this PR does not really help. However, we noticed that all failures occurred in a setup where cargo/rustc were running inside of a Windows docker container, using a target directory that is shared between the host and the container. Moving the target directory to a folder that is not visible to the host seems to resolve the problem (though further testing is needed). So it might be that a virus scanner or something else running on the container host might be the culprit here. |
So that directory is not shared? Then this could also be an issue with sharing mechanism which is not uncommon. |
include source error for LoadLibraryExW In rust-lang#107595, we added retry behavior for LoadLibraryExW on Windows. If it fails we do not print the underlying error that Windows returned. This made rust-lang#110889 a little harder to debug. In this PR I am adding the source error in the message if it is available.
include source error for LoadLibraryExW In rust-lang#107595, we added retry behavior for LoadLibraryExW on Windows. If it fails we do not print the underlying error that Windows returned. This made rust-lang#110889 a little harder to debug. In this PR I am adding the source error in the message if it is available.
On Windows, the compiler sometimes fails with the message
error: LoadLibraryExW failed
when trying to load a proc-macro crate. The error seems to occur intermittently, similar to #86929, however, it seems to be almost impossible to reproduce outside of CI environments and thus very hard to debug. The fact that the error only occurs intermittently makes me think that this is a timing related issue.This PR is an attempt to mitigate the issue by letting the compiler retry a few times when encountering this specific error (which resolved the issue described in #86929).