Cabal related exception when calling System.Eval.Haskell.eval

89 views
Skip to first unread message

adam.a...@gmail.com

unread,
Nov 21, 2015, 3:33:13 AM11/21/15
to haskell-stack
Hi,

When I try to use eval from System.Eval.Haskell in plugins-1.5.5.0 I get 
*** Exception: user error (Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with Cabal. Use the flag --package-db to specify a package database (it can be used multiple times).)

From trying to do this:

$ stack ghci
Using main module: Package `plop' component exe:plop-exe with main-is file: /Users/adam/plop/app/Main.hs
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
Configuring GHCi with the following packages: plop
GHCi, version 7.10.2: http://www.haskell.org/ghc/  :? for help
[1 of 2] Compiling Lib              ( /Users/adam/plop/src/Lib.hs, interpreted )
[2 of 2] Compiling Main             ( /Users/adam/plop/app/Main.hs, interpreted )
Ok, modules loaded: Lib, Main.
syntax:  :module [+/-] [*]M1 ... [*]Mn
*Main> import System.Eval.Haskell
*Main System.Eval.Haskell> eval "plop" []
*** Exception: user error (Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with Cabal. Use the flag --package-db to specify a package database (it can be used multiple times).)
*Main System.Eval.Haskell>


As I've just started trying out stack, and never grokked cabal, I'm not at all sure how to go about getting this to work.  Any advice would thus be welcome.

Thanks,

Adam

Neil Mitchell

unread,
Nov 21, 2015, 4:33:15 AM11/21/15
to adam.a...@gmail.com, haskell-stack
Hi Adam,

Alas, Cabal chokes on that environment variable, and stack sets it. I worked around this in the Shake test suite with the code at https://github.com/ndmitchell/shake/blob/master/src/Test/Docs.hs#L24

Basically, take GHC_PACAKGE_PATH and massage it to be a Cabal flag. I still don't understand why Cabal requires me to move the variable, when it could do it itself...

Thanks, Neil 
--
You received this message because you are subscribed to the Google Groups "haskell-stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stac...@googlegroups.com.
To post to this group, send email to haskel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/d8aa23e4-e40c-4328-b2ea-dabdb9b7a52c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages