-
Notifications
You must be signed in to change notification settings - Fork 175
Home
None, we have cabal-helper now. Woo :)
Make sure the dist/setup-config
file doesn't exist in your project directory (the directory also containing your *.cabal
file). When this file exists ghc-mod assumes you want to use cabal-install instead of Stack.
ghc-mod: $HOME/.stack/snapshots/x86_64-linux/lts-2.22/7.8.4/pkgdb/package.cache: GHC.PackageDb.readPackageDb: inappropriate type (not a ghc-pkg db file, wrong file magic number)
Your Stack resolver uses a different GHC version from what ghc-mod was linked with, in this case:
$ ghc-mod --version
ghc-mod version 5.3.0.0 compiled by GHC 7.10.2
VS.
$ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4
You need to recompile ghc-mod using GHC version 7.8.4 to fix this. Note that you can use the cabal install
option --program-suffix=SUFFIX
to append a GHC version number to ghc-mod's executable name so you can keep multiple copies of ghc-mod around without recompiling. There is no frontend support for automatically switching to the right executable though so you'll have to manage that manually using symlinks or a wrapper script. See also ghc-mod Issue: Support switching GHC versions without recompiling
ghc-mod: <command line>: cannot satisfy -package-id aeson-0.10.0.0-a37a650f6e5d5ca2347967c8f8609dfd:
aeson-0.10.0.0-a37a650f6e5d5ca2347967c8f8609dfd is unusable due to missing or recursive dependencies:
attoparsec-0.13.0.1-9f9155916734a226d3befd6aaf235548 base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d <...>
(use -v for more information)
Same root cause as above: readPackageDb: inappropriate type.
Failed to load interface for ‘Some.Module’ There are files missing in the ‘package-1.2.3’
package,try running 'ghc-pkg check'
Same root cause as above: readPackageDb: inappropriate type.
Full error message:
cabal-helper-wrapper: ghc: readCreateProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
cabal-helper needs a working ghc
executable at runtime to build it's wrapper component, when using only Stack's builtin GHC there is no ghc
on $PATH
hence this error.
To fix this simply add one of the paths in the output of the following command to your $PATH
environment variable.
printf '%s\n' ~/.stack/programs/*/ghc-*/bin/