-
Notifications
You must be signed in to change notification settings - Fork 42
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
[hint-0.8.0] removeDirectory: unsatisfied constraints (Directory not empty) #78
Comments
I've created a repository that reproduces the bug reliably on my machine. |
@limick did you ever make any progress on this? I noticed that with a standard "cabal new-install", the problem does not surface. The presence of the .dump-hi file appears related to the use of stackage. According to https://stackoverflow.com/questions/46397802/how-to-prevent-stack-from-creating-dump-hi-files , the dump-hi files are related to stack and template haskell. Not sure how to proceed at this point. |
@nwg I did not make any progress yet, I went back to using stackage LTS-11.22, which uses |
One fix is to use a custom hint with removeDirectoryRecursive in place of removeDirectory. I tried that and it seems to work fine. Another fix would be to derive the .dump-hi filename and delete that if it exists, too. I don't know what the best change to send upstream is yet, though. |
While it's good to have a reliable repro case, I would prefer to have a minimal repro case which only uses hint, not snap. Presumably, snap does something special which causes this |
Turns out the temporary file doesn't contain much:
In particular, it does not contain any template-haskell code. So what is snap doing which is causing those
|
I think the simple program itself has to use template haskell, and the dump-hi files are there to help with recompilation of modules that use TH. In snap's case, it is running the interpreter inside quotes inside a TH function. I'm not totally sure how the dump-hi system works, though, and this is just based off some simple google searching. More info on exactly what snap itself is doing: it's using a splice to generate a call to a function (in bracket quotes) that calls unsafeRunInterpreterWithArgs at runtime. I am also trying to reproduce this in a simple project. |
Also, if you are curious the relevant snap code is in snap-loader-dynamic in the file src/Snap/Loader/Dynamic.hs |
Thanks. I've managed to track it down to: This call to Still, since the file is created in a temporary folder which is created by hint, not by snap-loader-dynamic, it's not clear how snap-loader-dynamic could remove the file even if we decided that it was snap-loader-dynamic's responsibility to do so. Could you explain why snap-loader-dynamic needs to pass this parameter to hint? |
I can't explain why it's needed because i don't know enough about how it works.I might be able to get some help on IRC. |
In particular, I notice that snap-loader-dynamic already strips away some options from wherever it's getting its list from, such as |
I am not yet totally sure, but i think removing -ddump-hi will do the trick and be proper here. I've tested that it works and i think the interpreted environment will work better without it. |
Great! Closing then. |
Many thanks to both of you! |
I have a web application using the Snap web framework which (when compiled in development mode) uses a library called
snap-loader-dynamic
which in turn useshint
.After starting the app and making a request, the console shows:
The request handler does not return anything, it just gets killed after a timeout.
The temporary directory indeed contains a file: M512069275886764874574.txt. (File extension changed from
.dump-hi
to.txt
due to GitHub restrictions.)Relevant versions
The text was updated successfully, but these errors were encountered: