-
-
Notifications
You must be signed in to change notification settings - Fork 389
ghcide hangs during typechecking on a single-core machine or setting -j1
#727
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
Comments
If I set |
I recently discovered this independently. It happens also with +RTS -N1. It is caused by the Shake thread pool being bound by the number of capabilities. Ghcide runs a "daemon"-like thread to process Shake actions from a TQueue, and a main thread to do the typchecking. If the thread pool is of size 1, the daemon thread will be unable to progress and the typechecking thread will be unable to run. In general a threadpool should never be of size 1, so I would say this needs to be fixed in Shake. /cc @ndmitchell |
|
Cool, so we need to set |
I'd go for numCapabilities + 1 - if you're taking control of shakeThreads and want it at a precise value better to make sure there's no chance Shake infers a different number of threads to you. At one point Shake tried to infer the number of processors you had if it looked like you weren't on the threaded runtime, which would mess up any implicitness. |
Why the so shakeThreads = max 2 (fromMaybe numCapabilities (optThreads options)) |
If Ghcide runs a mostly-blocked thread then + 1 is appropriate. If it's a mostly-busy thread then |
@michaelpj from #1624:
|
-j1
I dont think that this problem exists anymore. |
Copied from #573 as this happens with just the
ghcide
command.I am bumping into this on NixOS with HLS 0.6.0 8.8.4, or ghcide 0.5.0 8.8.4
--verbose
doesn't say much interesting aside from[DEBUG] Set files of interest to: [(NormalizedFilePath "/home/alice/Foo.hs". OnDisk)] after
Type checking the files`Here is a reproducer in the form of a nixos test:
Either
nix-build repro.nix
and observe the hang$(nb tests/vim.nix -A driverInteractive)/bin/nixos-run-vms
alice
/foobar
I suspect that it could be something about the minimality of the environment which causes this?
strace
tells me that it's hung inFUTEX_WAIT_PRIVATE
, but that's not really surprisingThe text was updated successfully, but these errors were encountered: