haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 213 forks source link

Mismatching GHC versions on some projects. #1748

Closed tonyday567 closed 4 years ago

tonyday567 commented 4 years ago

I am using hie via spacemacs and it's working for some projects but not for others.

lsp-log:

Command "hie-wrapper --lsp -d -l /tmp/hie.log" is present on the path.
Command "hie-wrapper --lsp -d -l /tmp/hie.log" is present on the path.
Found the following clients for /Users/tonyday/haskell/online-market/src/Stats.hs: (server-id hie, priority 0)
The following clients were selected based on priority: (server-id hie, priority 0)
Mismatching GHC versions: GHC session is No System GHC Found., HIE is 8.8.3
You may want to use hie-wrapper. Check the README for more information
Using hie version: Version 1.2, Git revision b7fd5fb04b1711d433fc203751bc61624edc8dd0 (dirty) (3843 commits) x86_64 ghc-8.8.3
Command "hie-wrapper --lsp -d -l /tmp/hie.log" is present on the path.
Command "hie-wrapper --lsp -d -l /tmp/hie.log" is present on the path.
Found the following clients for /Users/tonyday/haskell/quilt/quilt.hs: (server-id hie, priority 0)
The following clients were selected based on priority: (server-id hie, priority 0)
Using hie version: Version 1.2, Git revision b7fd5fb04b1711d433fc203751bc61624edc8dd0 (dirty) (3843 commits) x86_64 ghc-8.8.3
Using hoogle db at: /Users/tonyday/.hoogle/default-haskell-5.0.17.hoo

The output in hie-wrapper --debug looks fine for the project that isn't working at the emacs level, and very similar to the ones that are working.

I am convinced that I have the same ghc versions across all projects. I use stack and only have complied projects with 8.8.3 (lts-15.6) after a clean install a few weeks ago.

Any advice how to go about debugging this would be appreciated.

fendor commented 4 years ago

How are you opening the projects? For stack projects, lsp-root needs to be in the same directory as stack.yaml. If you open your lsp-client in some parent directory, we can not properly decide which HIE version to use. However, if the correct version is used by "accident" (e.g. HIE just happens to be the version you want to use), you can ignore this warning.

tonyday567 commented 4 years ago

Digging in, I discovered that my issue was being driven by https://github.com/emacs-lsp/lsp-haskell/issues/51, and lsp was opening in a parent directory.

Thanks very much for the hint!

Closing.