[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Apr 22 07:01:45 EDT 2009


On Wed, 2009-04-22 at 12:21 +0200, david48 wrote:

>         Do you know what the problem was exactly? It's possible to get
>         problems with overlap between the user and global package dbs,
>         but the exact same problems can also happen just within the
>         global package db.
> 
> 
> One problem I had was while installing Lehksah. ( It was you who
> pointed me to the solution, thanks. )
> The last problem was for installing wxhaskell from the source. The
> first part compiled just fine, but the second wouldn't with a package
> problem. I didn't want to bother searching what the problem was, so I
> thought it was faster to reinstall ghc and compile wxhaskell then. (it
> worked) 
> Also, I think it's been a while I managed to do a cabal upgrade which
> didn't stop on a dependency issue.
> 
> Since I didn't write down the exact problems I had, I'm attempting a
> fresh install, and I'll write down what happens as I go.
> 
> 1) Installing GHC 6.10.2 from the tarball, I decided to give it a try
> to ./configure --prefix="/home/david/local"
> 2) Adding /home/david/local' to my PATH
> 3) I find a binary for cabal-install 0.6.0,
> 4) cabal update
> 5) cabal install cabal-install
> 
> Proceeds to download and compile HTTP-4000.0.6, then zlib-0.5.0.0
> which fails because I don't have zlib.h on this new system.
> 
> david at pcdavid2:~$ sudo apt-get install
> ... well there is no zlib-dev, libzlib-dev available on Jaunty. there
> is a zlib1-dev which fails to install, and a zlib1g-dev which works.
> 
> david at pcdavid2:~$ cabal-0.6.0 install cabal-install   again.
> This time zlib-0.5.0.0 compiles, but then :
> /usr/bin/ld: cannot find -lgmp

The ghc installer should really check for this at install time rather
than us waiting for the first time you compile something for it to fail.

> david at pcdavid2:~$ sudo apt-get install libgmp3-dev
> 
> david at pcdavid2:~$ download/cabal-0.6.0 install cabal-install
> againagain.
> 
> This time all goes well except that:
> Installing executable(s) in /home/david/.cabal/bin
> why the hell would cabal install binaries in a subdirectory of a
> hidden directory. Why not /home/david/bin or /home/david/local/bin ?

Yes, this is clearly suboptimal but getting agreement on where to put it
has not proved easy. There are users that will scream and shout if we
install to $HOME/bin by default.

Please add your thoughts on the best default behaviour to this ticket:
http://hackage.haskell.org/trac/hackage/ticket/289

In my opinion, what we should do is something like:

      * By default use symlink-bindir: ~/bin  if that directory is on
        the path (creating it if necessary -- but only if the dir was
        already on the $PATH). In this case we would inform users that's
        what we've done and about the location of the config file if
        they want to change it.
      * If the ~/bin directory is not on the $PATH then we should give a
        warning that binaries will be installed in ~/.cabal/bin and that
        the user should either put that on the $PATH or should change
        the config file to specify a symlink-bindir directory that is on
        the $PATH.

The symlink-bindir feature is "safe" in the sense that we never
overwrite files that are not already symlinks to the location where the
actual binaries are installed (eg usually ~/.cabal/bin). So in
particular we never overwrite any actual binaries you installed there
yourself.

> david at pcdavid2:~$ ghc-pkg check
> There are problems in package rts-1.0:
>   include-dirs: PAPI_INCLUDE_DIR doesn't exist or isn't a directory

That's a known bug in ghc-6.10.2 sadly. It means for the 6.10.2 release
that ghc-pkg check is not helpful (unless you fix it the way you did).

> david at pcdavid2:~$ download/cabal-0.6.0 install cabal-install
> Linking dist/build/cabal/cabal ...
> Installing executable(s) in /home/david/.cabal/bin
> 
> WTF?
> 
> david at pcdavid2:~$ vi .cabal/config
> install-dirs user
>   -- prefix: /home/david/local
>   -- bindir: $prefix/bin
>   -- libdir: $prefix/lib
> 
> I give up for now.

Lines starting with -- are comments. You need to uncomment the prefix
line for it to have an effect.

The latest version of cabal-install makes a config file with these
instructions at the top:

-- This is the configuration file for the 'cabal' command line tool.

-- The available configuration options are listed below.
-- Some of them have default values listed.

-- Lines (like this one) beginning with '--' are comments.
-- Be careful with spaces and indentation because they are
-- used to indicate layout for nested sections.

Unfortunately I think you mentioned that you grabbed a binary of an
older version so you missed out on the improved instructions.


Duncan



More information about the Haskell-Cafe mailing list