Haskell-ide-engine: HIE doesn't find cabal

Created on 21 Feb 2020  路  5Comments  路  Source: haskell/haskell-ide-engine

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?

bug nix can-workaround cabal-helper

Most helpful comment

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?

All 5 comments

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.

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).

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?

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?

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.

Was this page helpful?
0 / 5 - 0 ratings