You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you start a ghci session is started with "unused-packages" warning enabled you can get output like this:
<no location info>: warning: [-Wunused-packages]
The following packages were specified via -package or -package-id flags,
but were not needed for compilation:
- foo-0.2.0.0
- bar-1.0.0.1
at the end of loading iirc before it start compiling the first module. This seems to break ghcid, which, on first load, reports errors as expected, but then hangs on the first reload. Of course fixing the warning (removing foo/bar or disabling the warning if your setup just adds spurious -packages) is the obvious fix, but it might be worth making ghcid more robust, as just hanging without any error output is annoying to debug.
Do you think it is worth fixing this? Suggestion on best approach?
This happens for us on a slightly larger project; I somewhat assume it is easy to reproduce, but if it is not I can of course come up with a sample project setup for reproduction.
The text was updated successfully, but these errors were encountered:
LennartSpitzner
changed the title
Do not break on `-Wunused-packages
Do not break on -Wunused-packagesMar 15, 2022
Actually the same warning is also printed with cabal repl.
So maybe this problem should be addressed there (in GHCi or cabal, idk)? cabal build works as expected at least :)
I think the right solution is to adjust the parser to take account of this warning. Unconditionally disabling warnings is a bit annoying because it varies between GHC version, they can be set later on in the process, and you also lose warnings that are presumably useful. PR welcome!
If you start a
ghci
session is started with "unused-packages" warning enabled you can get output like this:at the end of loading iircbefore it start compiling the first module. This seems to breakghcid
, which, on first load, reports errors as expected, but then hangs on the first reload. Of course fixing the warning (removing foo/bar or disabling the warning if your setup just adds spurious-package
s) is the obvious fix, but it might be worth makingghcid
more robust, as just hanging without any error output is annoying to debug.I guess this would need an addition to https://github.com/ndmitchell/ghcid/blob/master/src/Language/Haskell/Ghcid/Parser.hs#L60, right? Or would it be better (for now) to just force the warning off for the time being (by insert a
:set
into theghci
session)Do you think it is worth fixing this? Suggestion on best approach?
This happens for us on a slightly larger project; I somewhat assume it is easy to reproduce, but if it is not I can of course come up with a sample project setup for reproduction.
The text was updated successfully, but these errors were encountered: