Open guibou opened 3 years ago
Haha, I just found that:
https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/Unit/State.hs#L860
Not sure we had seen it previously, but it explains the reasons behind -hide-all-packages
.
I hit this issue again today on a new codebase.
Describe the bug
The haskell language server will fail on a file if that file is part of a package which depends on two package with the same package name, but different package id.
For example, we have a file
File.hs
is part of anhaskell_library
//lib
which depends on//foo:time
and//biz:time
.//foo:time
and//biz:time
are two different (Haskell) packages, with the same Haskell package name (i.e.time
) but different package id (egtime-1234
andtime-5678
).In this context, the language server is not able to "work" on
File.hs
and complains about:To Reproduce
Well, I may come back later on this issue to provide a proper reproduction. In the meantime:
haskell-language-server
0.8.0.0 (instead of ghcide) and setup it like described here: https://rules-haskell.readthedocs.io/en/latest/haskell-use-cases.html#configuring-ide-integration-with-ghcidehaskell-language-server path/to/My/Haskell/Module.hs
shows the error message.Not that this error message does not appear on other modules in my codebase as long as they do not depend at the same time on two packages with the same package name (here
time
).Expected behavior
It should not fail ;)
Environment
Additional context
402 and associated are linked. The problem is that GHC does have a bug that, in presence of the same package name, GHC will pick the latest in the command line (even if
-package-id
is used) unless-hide-all-packages
is part of the command line.I fixed locally the problem with the following change in my
.hie-bios
file: