Skip to content
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

Crash/incorrect error message on circular dependency #377

Open
cgeorgii opened this issue Jun 15, 2023 · 2 comments
Open

Crash/incorrect error message on circular dependency #377

cgeorgii opened this issue Jun 15, 2023 · 2 comments

Comments

@cgeorgii
Copy link

cgeorgii commented Jun 15, 2023

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:

  • It crashes; or
  • It reports All good (X modules, at 19:12:42), where X is a number lower than the number of actual modules in the project, i.e. not all modules were typechecked.

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
Copy link

ffaf1 commented Nov 6, 2023

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
Copy link

smelc commented Jul 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants