2

I'd like to, within a client program, use the GHC API from a modified version of GHC. Its easy enough to get the GHC sources and build and install the modified GHC, but installing the modified GHC causes all older (Cabal) dependencies to break.

Consequently, I cannot use the GHC API as ghc -v says:

package ghc-7.0.3-... is unusable due to missing or recursive dependencies:...

Any clues on how to proceed?

Thanks!,

Ranjit.

Don Stewart
  • 137,316
  • 36
  • 365
  • 468
Ranjit Jhala
  • 1,242
  • 8
  • 18

1 Answers1

1

You must build a custom version of GHC first, then install all the packages you need. That way, everything will be linked against your custom GHC, and you will be fine.

Don Stewart
  • 137,316
  • 36
  • 365
  • 468
  • OK, let me try this: 1. install the binary ghc-7.0.3, then 2. use it to build/install modified ghc? I'll give this a whirl. However, does this mean that everytime I rebuild GHC I might have to reinstall everything else? (As of now, there is no modification, am just trying to use the GHC-API from a custom build as a warm up...) Longer term, I'm trying to add a little more source information `SrcSpan` to the `CoreExpr`... – Ranjit Jhala May 19 '11 at 23:52
  • Sounds like your broke your GHC build fairly well. – Don Stewart May 20 '11 at 02:40
  • Whew, looks like its because the latest GHC (7.1.XXX) uses Cabal-1.11 which throws off the haskell-platform build scripts. I just built a custom GHC from the 7.0.3 sources and that seems to work fine. thanks! – Ranjit Jhala May 20 '11 at 02:47
  • Actually the above didn't really work. [Simon Marlow](http://research.microsoft.com/en-us/people/simonmar/) pointed me to [this](http://hackage.haskell.org/trac/ghc/wiki/Debugging/InstallingPackagesInplace) which works like a charm... – Ranjit Jhala May 20 '11 at 18:32