-
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
Spurious PermissionDenied error with cargo's rename_with_link_search_path
test in AppVeyor
#48775
Comments
I've made an attempt to mitigate this at rust-lang/cargo#5131 |
I'm pretty certain the failing call to unwrap is here and AFIAK this is the same error that we've been battling with since the beginning of time in MSVC. On Windows you can't rename/delete files that are currently open, which is typically fine unless something unkknowingly opens one of your files. I think (basically never confirmed) that on MSVC the link.exe linker will spawn off mspdbsrv.exe to finish in the background after link.exe exits. I believe this means that when What's happening here is that this test is specifically testing that if the build directory is renamed then it doesn't try to use the old contents, so it requires the old build directory to get blown away. Now that fails spuriously on MSVC and I have no idea how to fix it... I'd love to figure out a way to either disable this mspdbsrv.exe background behavior or figure out a way to synchronize with it. In the meantime though the only way I'd know how to solve this is to disable the test on MSVC, which while possible is of course not great... |
This looks like it may have some potential: http://blog.peter-b.co.uk/2017/02/stop-mspdbsrv-from-breaking-ci-build.html -- we may be able to spawn our own mspdbsrv and then that way avoid it having any file handles open that we don't want it to have open. |
Nice find! I think we could definitely try that but I'm not sure if it'd solve our problem. I was gonna write out steps with an example but apparently nothing I do locally seems to convince mspdbsrv.exe to get spawned... I'm not sure! Historically though I think the problem has been that mspdbsrv.exe doesn't itself hold anything open but rather is writing out a file as we're trying to delete it. AFAIK the link.exe exit isn't synchronized with the output of mspdbsrv.exe, so you might have files emitted after the linker exits (like debuginfo). This means that if try to delete the directory at the same time it can cause problems. I'm... not sure why I can't reproduce this locally. I wonder if newer versions of visual studio have removed mspdbsrv.exe? Maybe I'm not using the right flags? hmm... |
I've attempted to mitigate this in rust-lang/cargo#5488 |
Since this hasn't appeared in 3.5 years, I'm going to close this as resolved. |
Symptom: The
check-aux
job fails with the following log:First seen in #48476 (comment), and again in #47463 (comment).
The text was updated successfully, but these errors were encountered: