Dirs created by GHC.Utils.TmpFs.newTempDir cannot be removed
GHC.Utils.TmpFs.newTempDir creates a new
ghc_N subdirectory in a temp directory, but this directory cannot be removed. The result is a warning at the end of the GHC run.
It's not possible to clean this
ghc_N subdirectory using
removeFileand fails for directories
- the to-clean list is kept in a
Set FilePathand doesn't preserve the order in which the files were added, so a dir could potentially be removed before the files contained in it.
I've come up with two ideas to fix it
- when removing a top-level ghc temp dir, automatically remove empty
ghc_Nsubdirs inside it (in
- keep track of all created
newTempDirand remove them as the first step in
Any preferences or other ideas?