forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows: Fix deleting directory in JNI code
`bazel clean` command sometimes fails on Windows with "Directory not empty" error. But when checking the directory after the failure, we don't see any file or directory under it. After debugging, we cannot find any unclosed file handle, either. However, when trying to delete the bazel output directory with `rm -rf" it succeeds everytime. The reason is that Cygwin worked around a Windows issue at this commit: Alexpux/Cygwin@28fa2a7 The problem is, I quote: "" Intensive testing shows that sometimes directories, for which the delete disposition has already been set, and the deleting handle is already closed, can linger in the parent dir for a couple of ms for no apparent reason (Windows Defender or other real-time scanners are suspect). "" In this commit, we use a similar way to retry deleting the directory when its "deleted" sub-dirs are still lingering under it. Related bazelbuild#5907
- Loading branch information
1 parent
1b4c37c
commit 5cb281e
Showing
1 changed file
with
87 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters