flycheck-haskell and doctest don't work on Cabal 3.0 v2-build project

前端 未结 1 735
栀梦
栀梦 2021-01-20 12:33

I tried to create a Nix-style local build (v2-build) project on Cabal 3.0.
But several development tools (flycheck-haskell and doctest) don\'t work.
They worked on n

相关标签:
1条回答
  • 2021-01-20 12:43

    Your doctest doesn't find proper GHC_ENVIRONEMNT.

    Since Cabal 3.0, cabal v2-build doesn't generate environment files by default.

    Since Cabal 3.0, defaults to never. Before that, defaulted to creating them only when compiling with GHC 8.4.4 and older (GHC 8.4.4 is the first version that supports the -package-env - option that allows ignoring the package environment files). https://www.haskell.org/cabal/users-guide/nix-local-build.html#cfg-field-write-ghc-environment-files

    So you should set this option on v2-build.

    $ cabal v2-build --write-ghc-environment-files=ghc8.4.4+
    

    Or you can write this in $HOME/.cabal/config for default cabal behavior.

    write-ghc-environment-files: ghc8.4.4+
    
    0 讨论(0)
提交回复
热议问题