-
Notifications
You must be signed in to change notification settings - Fork 841
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
Have stack run "ghc-pkg check" #1811
Comments
Hey, I'm receiving this error right now:
I'm somewhat lost: how do I fix this? Nuke the |
@bollu One option is to run |
Thanks, that worked! On Wed, 5 Oct 2016 at 05:00 Michael Sloan [email protected] wrote:
|
Not sure, my theory is that it occurs when a process gets terminated in the midst of writing out some file / set of files. It's quite likely that Cabal or ghc's error handling in these circumstances are imperfect. One of the reason to do this |
same happened to me and i fixed by unregistering. since i was using a turtle script with stack as interpreter i specified the related resolver from the command line:
|
@mgsloan "my theory is that it occurs when a process gets terminated in the midst of writing out some file" Two more theories:
The unregister workaround worked in my case as well. The number of times (probably like 40) I had to do this (for various different packages) while installing a single library (turtle, installing from its source to test an update to this issue) was considerable though, so I'm betting on the antivirus theory. :) |
This is interesting... aren't concurrent runs supported? I've been wondering the same also about other package/dependency management/build tools ... i wonder about the expectations users have about this, since usually we run such commands one at a time, while with more advanced usage it becomes common to run multiple related commands in parallel |
@danse I am not sure, just throwing it out as a potential cause, since when things broke for me, I had two of them running. I'm still betting on the antivirus :) |
not familiar with stack's code, |
It seems like a good idea to run
ghc-pkg check
periodically. I just got this error message (not sure what the cause is):Indeed,
ghc-pkg check --simple-output
yields a list of broken packages. Presumably we're trying to avoidghc-pkg check
yielding any broken packages (always unregistering things that get broken).Sidenote: We should really have a way to reinstall snapshot packages in this circumstance: #1476
I think the best approach to this would be to run
ghc-pkg check --simple-output
at the beginning of the build command execution, and compare with the output at the end of execution (even if an exception is thrown). If packages are freshly broken, complain loudly.One question is whether this should be done by default - it could have quite a bit of runtime overhead. We could have some stack.yaml flag like
dev-mode: True
which enables costly checks and assertions and such (intended to be specified in the global stack.yaml).The text was updated successfully, but these errors were encountered: