-
Notifications
You must be signed in to change notification settings - Fork 414
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
Sandboxing on Windows does not work in presence of a virus scanner #11425
Comments
I tried |
The 3 packages of Coq Platform which fail quite reliably (> 80%) unless I switch the virus checker completely off (not just advanced features) are:
all other opam packages used by Coq Platform (about 180) compile reliably with virus checker enabled. |
I modified the windows unlink function here to retry 30x in 1s intervals in case of failure. This appears to work (and it does cost time only if it would have failed otherwise, but I am not sure if some error cases should be excluded or only some included). I will do a PR and we can discuss details in how to do this exactly there. |
Fixes ocaml#11425 Signed-off-by: Michael Soegtrop <[email protected]>
Fixes ocaml#11425 Signed-off-by: Michael Soegtrop <[email protected]>
Expected Behavior
Builds pass without issues
Actual Behavior
I see in various builds a lot errors of the form:
this does not happen with all opam packages, but it happens very reliably with some, e.g.
sel
andcoq-elpi
. Interestingly they are both from the same author (@gares FYI). But I can't say there anything particularly strange about these packages. In all cases the remaining file in the sandbox isppx.exe
.Reproduction
Build via opam e.g. the package
sel
on Windows when a virus scanner is present (I use GData, but it shouldn't matter much). It should fail > 80% with such an error.The issue is that on Windows, unlike Linux and MacOS, files are identified by name and not by inode. On Linux a file name is just a link to an inode. If a a file is deleted, it doesn't delete the file, it just removes the inode link. If the inode link is 0, the file itself is deleted. An open file also has an inode link, so on Linux one can delete open files. On Windows this does not work. I file cannot be deleted while it is open.
The issue is that virus scanners tend to inspec all new .exe files, so they have this file opened, which means you cannot delete it. This is the reason why removing the sandbox fails on Windows if a virus scanner is present.
Specifications
dune
(output ofdune --version
): 3.16.1ocaml
(output ofocamlc --version
): 4.14.2Additional information
Possible remedies are:
The text was updated successfully, but these errors were encountered: