[Haskell-cafe] Re: Completely confused by cabal

Achim Schneider barsoap at web.de
Sun Mar 22 07:19:36 EDT 2009

Colin Paul Adams <colin at colina.demon.co.uk> wrote:

>     Achim> uh... because you're a mere user and don't have the rights
>     Achim> to do so?
> No, I own the machine.
Well, but it neither knows nor cares, unless you log in as root.
"colin" isn't allowed to write to /usr/local/lib/ghc-6.11.20090319/ .
root's and colin's home directories are distinct, as well, that's why
both need to do cabal update to install stuff: Users can't read root
(or any other user's) home directories; root could read colin's home
directory, but musn't trust any data in it, as colin could use that
trust to weasel root access.

> I can't. It doesn't provide up-to-date ghc and things.
<insert snappy switch-to-gentoo comment here>

>     Achim> programs with your user account, inside your home
>     Achim> directory, is perfectly acceptable (and traditional) under
>     Achim> unix.
> But it means I have to install everyhting twice - once as --user, once
> as --global.
No, you don't, the database ghc uses to compile stuff is a union of
both databases, user installs overriding global installs. Assuming that
you're the machine's only user, you only ever need to install stuff as
that user:

ksf at solaris ~ % ghc-pkg list
    Cabal-, HTTP-3001.1.4, QuickCheck-,
    QuickCheck-, X11-1.4.4, X11-xft-0.3, array-,
    base-, base-, binary-0.4.4, bytestring-,
    cairo-0.10.0, containers-, directory-,
    editline-, filepath-, filepath-, gconf-0.10.0,
    (ghc-6.10.1), ghc-paths-, ghc-prim-, glade-0.10.0,
    glib-0.10.0, gtk-0.10.0, gtkglext-0.10.0, gtksourceview2-0.10.0,
    haddock-2.4.1, haskell-src-, haskell98-, hpc-,
    html-, integer-, mozembed-0.10.0, mtl-,
    network-, old-locale-, old-time-,
    packedstring-, parsec-3.0.0, pretty-,
    process-, random-, readline-,
    regex-base-0.93.1, regex-compat-0.92, regex-posix-0.93.2, rts-1.0,
    soegtk-0.10.0, stm-, svgcairo-0.10.0, syb-,
    template-haskell-, unix-, utf8-string-0.3.3,
    MemoTrie-0.4.3, bytestring-mmap-0.2.0, bytestring-trie-0.1.4,
    extensible-exceptions-, ipprint-0.3, iteratee-0.1.1,
    mmap-0.2, regex-posix-

I basically did emerge cabal-install to bootstrap my installation, then
emerge gtk2hs as it's not available via hackage. Then, I install what
I need to hack as user using cabal install. (I recently nuked my
~/.cabal and ~/.ghc, that's why the user database is that small).

Installing ghc as user works equally well.

(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.

More information about the Haskell-Cafe mailing list