ndmitchell / ghcid

Very low feature GHCi based IDE
Other
1.13k stars 114 forks source link

Crash/incorrect error message on circular dependency #377

Open cgeorgii opened 1 year ago

cgeorgii commented 1 year ago

Description

Sometimes during a refactor I might accidentally introduce a module import that causes a circular/cyclical dependency. ghcid might then fail in one of two ways:

I'm not sure how to trigger one or the other, they seem to happen randomly/under unclear circumstances.

Since HLS manages to identify the cycle and report correctly, I believe this is a bug in ghcid.

How to reproduce

Create two modules A and B and import them from one another:

-- src/A.hs
module A where
import B
-- src/B.hs
module B where
import A

Run ghcid:

$ ghcid --command "cabal repl component-name"

Witness the issue.

Version information

❯ ghcid -V
Auto reloading GHCi daemon v0.8.7
ffaf1 commented 1 year ago

Indeed I get No files loaded, nothing to wait for. Fix the last error and restart. and ghcid quits.

It would be prettier if ghcid did not exit, it is a bit of a nuisance having to restart it.

smelc commented 4 months ago

Reported as a potential good issue for bench time, cc @tek @yannham