4

So, an apt-get update in Ubuntu updated my GHC-version to 7.10.3 from this repository.

After this update, everything broke, so I switched to 7.10.2, from that same repository.

Almost everything is working now, except for ghc-mod, which when run, gives the following error when I try to check my project:

ghc-mod: <command line>: cannot satisfy -package-id base-4.8.2.0-9bb65294401b6ef629a229811a1f4249
    (use -v for more information)

When I run cabal-install on my project, I don't get any dependency errors.

What might be causing this problem? Is there a setting within GHC-mod that needs to be changed, or a path that needs to be specified?

I can provide more information, but I just don't know where to start with this error.

My build-depends section in the .cabal file looks like this:

  build-depends:       base >=4.8 && <4.9
                       , mtl
                       , parsec
                       , pretty
                       , readline

Like I said, these dependencies all install fine.

Erik Kaplun
  • 37,128
  • 15
  • 99
  • 111
jmite
  • 8,171
  • 6
  • 40
  • 81

1 Answers1

1

It seems restarting the ghc-mod process after a rm -rf .stack-work helps; stack clean doesn't seem "strong" enough for some reason — ghc-mod is not particularly clever about when it should clean and rebuild — wish that wasn't the case but it is.


Alternatively, your ghc-mod might need to be recompiled with whatever GHC version it's being used with; if you have multiple versions of GHC installed and need ghc-mod for a specific one, pass -w path/to/ghc to cabal install, for example in my case I have 8.0.1 globally but need ghc-mod with 7.10.3, which stack has already installed for me under .stack/programs:

~/my-sandboxes/ghc-mod-7.10.3 $ cabal install -w ~/.stack/programs/x86_64-osx/ghc-7.10.3/bin/ghc ghc-mod

otherwise, a simple cabal install ghc-mod should do.

Erik Kaplun
  • 37,128
  • 15
  • 99
  • 111
  • This is probably a solution, but I wasn't using stack when I originally encountered this. – jmite Jun 08 '16 at 18:16