-
Notifications
You must be signed in to change notification settings - Fork 4k
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 #5907 Closes #7462. PiperOrigin-RevId: 234777436
- Loading branch information
1 parent
714e3f2
commit 5400753
Showing
2 changed files
with
133 additions
and
18 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
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