haskell-ide-engine icon indicating copy to clipboard operation
haskell-ide-engine copied to clipboard

HIE doesn't find cabal

Open pmiddend opened this issue 5 years ago • 5 comments
trafficstars

I've set up hie using all-hies on a NixOS system. Opening a Haskell file and explicitly invoking first direnv-mode and then lsp results in an error in *hie::stderr* saying it cannot find Cabal == 3.0.0.0.

Opening a terminal, changing to the directory and executing cabal --version, however, gives:

cabal-install version 3.0.0.0

I read about the direnv and lsp race condition, which is why I explicitly enabled direnv and then lsp, but to no avail.

How can I debug this further?

pmiddend avatar Feb 21 '20 13:02 pmiddend

is this really a hie bug? Can you try to execute hie --debug in the root of your project and if this fails, link some logs? If it succeeds, you can try to pass a filepath like hie --debug src/ to attempt load your project into hie and report the logs. If all that works, the problem is not with hie itself.

fendor avatar Feb 21 '20 13:02 fendor

Alright, so this does not succeed. Find attached the log output of hie --debug:

debug.log

Note, again, that cabal --version does succeed, as does ghc --version (which outputs 8.6.5).

pmiddend avatar Feb 21 '20 14:02 pmiddend

I see! Did you try to run cabal update, btw? However, this looks like a bug in cabal-helper or some nix issue. Would you mind trying whether creating a file hie.yaml with the contents

cradle:
  cabal:

and check if that works?

fendor avatar Feb 21 '20 15:02 fendor

Thanks @fendor! That did the trick.

I don't mind having hie.yaml around, shall I close the issue or is it worth investigating this further?

pmiddend avatar Feb 21 '20 16:02 pmiddend

It looks like a bug of cabal-helper, but since this is issue actually persists, I would prefer to have the issue open so that it documents the problem.

fendor avatar Feb 21 '20 16:02 fendor