Skip to content
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

removeDirectoryRecursive failures on Windows #129

Closed
sjakobi opened this issue Nov 17, 2021 · 4 comments
Closed

removeDirectoryRecursive failures on Windows #129

sjakobi opened this issue Nov 17, 2021 · 4 comments
Labels
type: x-duplicate This is a duplicate of another issue in this project.

Comments

@sjakobi
Copy link
Member

sjakobi commented Nov 17, 2021

I've been encountering this issue in CI jobs for dhall-haskell (dhall-lang/dhall-haskell#2336). The failures look like this:

C:\Users\runneradmin\AppData\Local\Temp\stack-eadfc3912a464ffd\pretty-simple-4.0.0.0\.stack-work\dist\274b403a\setup: removeDirectoryRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:RemoveDirectory "\\\\?\\C:\\Users\\runneradmin\\AppData\\Local\\Temp\\stack-eadfc3912a464ffd\\pretty-simple-4.0.0.0\\.stack-work\\dist\\274b403a\\setup": unsatisfied constraints (The directory is not empty.)

Similar failures were reported in haskell/cabal#7240. A fix was proposed for Win32 in haskell/win32#129, but rejected. Is this something that could be fixed in directory?!

@sjakobi
Copy link
Member Author

sjakobi commented Dec 30, 2021

I'm still getting these failures.

@Rufflewind What do you think about this issue?

@Rufflewind
Copy link
Member

@sjakobi
Copy link
Member Author

sjakobi commented Feb 2, 2022

Thanks for the link to #110! If I understand the discussion there correctly, an implementation would fix this issue here. Feel free to close this issue as a duplicate.

Is there a rough ETA for an implementation of #110? Or should Cabal and stack maintainers wrap removeDirectoryRecursive in retry for now?

  • Do you have a CI script that can reproduce the issue with high probability?

Unfortunately I don't. I've seen stack builds fail due to this issue from time to time, so I suspect that a script that repeats some stack install task will eventually fail.

@Rufflewind
Copy link
Member

Rufflewind commented Feb 4, 2022

There's some ideas thrown around in #110 but I'm not aware of an easy fix on this issue. The lack of a reliable means reproduce this bug doesn't help.

The current known workaround is to retry on Windows. The number of retries may depend on the quantity of files you're deleting as well as the speed of the machine.

(Marked as dupe of #110)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: x-duplicate This is a duplicate of another issue in this project.
Projects
None yet
Development

No branches or pull requests

2 participants