[Haskell-cafe] Re: Completely confused by cabal

Colin Paul Adams colin at colina.demon.co.uk
Sun Mar 22 08:37:53 EDT 2009


>>>>> "Andrea" == Andrea Vezzosi <sanzhiyan at gmail.com> writes:

    Andrea> On Sun, Mar 22, 2009 at 12:51 PM, Colin Paul Adams
    Andrea> <colin at colina.demon.co.uk> wrote:
    >>>>>>> "Achim" == Achim Schneider <barsoap at web.de> writes:
    >> 
    >>    Achim> Colin Paul Adams <colin at colina.demon.co.uk> wrote:
    >>    >> So why doesn't it find packages then, when they are
    >> installed?     >>    Achim> I've got no idea, what exactly are
    >> you trying to do, and    Achim> how?
    >> 
    >> I'm trying to re-compile ghc 6.11 and it doesn't find parsec.

    Andrea> when cabal is invoked by root, like in su -c "cabal ..."
    Andrea> or su -c "runghc Setup ...", it won't see the user
    Andrea> packagedb, but there's rarely a reason to do so.  Usually
    Andrea> only the install phase needs to be done as root, while
    Andrea> building and configuring can be done as user.  For ghc
    Andrea> you'd want to run ./configure and make as user and make
    Andrea> install as root.  For normal packages, if you want to
    Andrea> install them system wide, you'd use something like cabal
    Andrea> install --global --root-cmd=sudo foo

OK. I did:

cabal install parsec --global --root-cmd=sudo

and now when I try to make ghc I get:

verify/SimplIface.lhs:16:7:
    Could not find module `Text.ParserCombinators.Parsec.Language':
      it is a member of the hidden package `parsec-2.1.0.1'
      Use -v to see a list of the files searched for.

so I've managed to get parsec installed.

Now I think I have to add it to a .cabal file somewhere.

verify is a directory I added as a sub-directory of compiler, so i
tried adding the following line to compiler/ghc.cabal:

   Build-Depends: parsec >= 2 && < 3

but it made no difference.
-- 
Colin Adams
Preston Lancashire


More information about the Haskell-Cafe mailing list