ndmitchell / weeder

Detect dead exports or package imports
BSD 3-Clause "New" or "Revised" License
124 stars 8 forks source link

weeder crashes with "getDirectoryContents:openDirStream: does not exist" #12

Closed osa1 closed 7 years ago

osa1 commented 7 years ago

I just run weeder on a large project with multiple cabal packages. It worked for some of the packages but at some point it crashed with

weeder: <project>/.stack-work/downloaded/W6D33wgrWbLW/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0: getDirectoryContents:openDirStream: does not exist (No such file or directory)

Re-running weeder fails with the same command. Other than this line there aren't any error-related output. Let me know if I can help with debugging (if you need output of a command etc.). Thanks.

EDIT: This is on Linux.

ndmitchell commented 7 years ago

I don't suppose this project is open source by any chance? That would be the easiest way to reproduce...

It seems like a simple recursive directory traversal is failing, and I've no idea why. Are you expecting hard links etc in that directory? Any idea why you have a .stack-work inside another .stack-work?

osa1 commented 7 years ago

No unfortunately this is project is not open source.

I'm not sure why I have .stack-work inside a .stack-work here. Maybe this is how stack build deps that are not on stackage? I'm not sure ..

I'm wondering if this could be a symlink issue. The directory has some symlinks (generated by nix) and I remember having a problem with a directory traversal function in the presence of symlinks.

osa1 commented 7 years ago

It turns out we're not using the dependency that was causing this problem. I removed it from .stack.yaml and now weeder is working fine. Closing.