
Hi, I just got cabal-install working. However, I have a problem using it. My GHC is installed in a user-specific location, so when I do the Cabal dance, I have to specfiy "Setup configure --prefix=$HOME/ghc". Now with "cabal install", I can not figure out where to specify the --prefix. Cabal always complains "failed to install package". Help is appreciated. Steve

On Fri, 2008-01-18 at 23:44 -0500, Chris Ball wrote:
Hi Steve,
Now with "cabal install", I can not figure out where to specify the --prefix. Cabal always complains "failed to install package".
I think you're just missing a "--user":
$ cabal install --prefix=$HOME --user foo
The prefix can also be set in the $HOME/.cabal/config file. BTW, In the development version of cabal-install --user is the default and the default user prefix is $HOME/.cabal (though both can be changed in the config file). I'd also recommend anyone trying out cabal-install to ignore the old version on hackage and go straight for the development version. It's a tad harder to get installed since it also needs the development version of the Cabal lib, but it has so many issues fixed. darcs get --partial http://darcs.haskell.org/cabal cd cabal make setup ./setup configure --prefix=$HOME/.cabal --user ./setup build ./setup install cd .. darcs get --partial http://darcs.haskell.org/cabal-install cd cabal-install runghc Setup.hs configure --prefix=$HOME/.cabal --bindir=$HOME --user runghc Setup.hs build runghc Setup.hs install This assumes $HOME/bin is on your path and that you already have the zlib and HTTP packages installed. Then get the latest hackage package list with: cabal update For a quick guide see: cabal --help There's also bash command line completion support: source bash-completion/cabal Then give it a try. Report any complaints or requests in the hackage trac: http://hackage.haskell.org/trac/hackage/ Duncan

On Jan 19, 2008 9:18 AM, Duncan Coutts
I think you're just missing a "--user":
$ cabal install --prefix=$HOME --user foo
The prefix can also be set in the $HOME/.cabal/config file.
Syntax? Something like: prefix: /path/to/my/ghc ?
BTW, In the development version of cabal-install --user is the default and the default user prefix is $HOME/.cabal (though both can be changed in the config file).
Is this newer than 12 hours ago? I tried "cabal install --prefix=/path package" (without --user). That did not seem to work... Steve

Just tried to test drive another feature and got the nasty error:
cabal list Stack space overflow: current size 8388608 bytes. Use `+RTS -Ksize' to increase it.
On Jan 19, 2008 9:27 AM, Steve Lihn
On Jan 19, 2008 9:18 AM, Duncan Coutts
wrote: I think you're just missing a "--user":
$ cabal install --prefix=$HOME --user foo
The prefix can also be set in the $HOME/.cabal/config file.
Syntax? Something like: prefix: /path/to/my/ghc ?
BTW, In the development version of cabal-install --user is the default and the default user prefix is $HOME/.cabal (though both can be changed in the config file).
Is this newer than 12 hours ago? I tried "cabal install --prefix=/path package" (without --user). That did not seem to work...
Steve

On Sat, 2008-01-19 at 09:30 -0500, Steve Lihn wrote:
Just tried to test drive another feature and got the nasty error:
cabal list Stack space overflow: current size 8388608 bytes. Use `+RTS -Ksize' to increase it.
Oops, silly error on my part. darcs pull and it's fixed. Duncan

On Sat, 2008-01-19 at 09:27 -0500, Steve Lihn wrote:
On Jan 19, 2008 9:18 AM, Duncan Coutts
wrote: I think you're just missing a "--user":
$ cabal install --prefix=$HOME --user foo
The prefix can also be set in the $HOME/.cabal/config file.
Syntax? Something like: prefix: /path/to/my/ghc ?
Yes, but using ghc's path would be a really bad idea. Actually there's "user-prefix:" and "global-prefix:" for the prefixes to use when using --user or --global installs.
BTW, In the development version of cabal-install --user is the default and the default user prefix is $HOME/.cabal (though both can be changed in the config file).
Is this newer than 12 hours ago? I tried "cabal install --prefix=/path package" (without --user). That did not seem to work...
Remember, --user is default unless overridden by --global. So if you are trying to install as root that probably will not work since it'll probably have been built against packages that were in your user's package db but are not in your root users package db. We've not concentrated very much on global installs yet for cabal-install. We've been trying to make ordinary user installs "Just Work"tm. There was a bug a couple days ago where the prefix given on the command line was being overridden from the one given in the config file. That's now fixed. The command line overrides the saved config settings. So if it's still not working for you, you'll have to give more details. Details of what command you were using exactly and what the error message was. Duncan

Duncan, I got the latest cabal. The stack overflow is fixed. But the install command still does not work (on a very simple package). Attached is the verbose output. It does not like to proceed somewhere between configure and build. But the verbose is not telling why! I also attached my cabal dance with exactly the same configure options. ---- /home2/ecoin/garden> cabal install -v HTTP-Simple /home2/ecoin/ghc/bin/ghc --numeric-version looking for package tool: ghc-pkg near compiler in /home2/ecoin/ghc/bin found package tool in /home2/ecoin/ghc/bin/ghc-pkg /home2/ecoin/ghc/bin/ghc-pkg --version /home2/ecoin/ghc/bin/ghc -c /tmp/tmp26702.c -o /tmp/tmp26702.o /usr/bin/ld -x -r /tmp/tmp26702.o -o /tmp/tmp26703.o Reading installed packages... /home2/ecoin/ghc/bin/ghc-pkg list --global --user 'HTTP-Simple-0.1' is cached. Extracting /home2/ecoin/.cabal/packages/hackage.haskell.org/HTTP-Simple/0.1/HTTP -Simple-0.1.tar.gz to /tmp/TMPHTTP-Simple-0.1... Creating dist/setup (and its parents) /home2/ecoin/ghc/bin/ghc --make Setup.lhs -o dist/setup/setup -odir dist/setup - hidir dist/setup [1 of 1] Compiling Main ( Setup.lhs, dist/setup/Main.o ) Linking dist/setup/setup ... dist/setup/setup configure --verbose=2 --ghc --prefix=/home2/ecoin/htools --user cabal: Error: some packages failed to install: HTTP-Simple-0.1 ---- Configuring HTTP-Simple-0.1... Warning: No build-type specified. If possible use build-type: Simple Preprocessing library HTTP-Simple-0.1... Building HTTP-Simple-0.1... [1 of 1] Compiling Network.HTTP.Simple ( Network/HTTP/Simple.hs, dist/build/Netw ork/HTTP/Simple.o ) /usr/bin/ar: creating dist/build/libHSHTTP-Simple-0.1.a Installing: /home2/ecoin/htools/lib/HTTP-Simple-0.1/ghc-6.6.1 Registering HTTP-Simple-0.1... Reading package info from "dist/installed-pkg-config" ... done. Saving old package config file... done. Writing new package config file... done.

On Mon, 2008-01-21 at 10:15 -0500, Steve Lihn wrote:
Duncan, I got the latest cabal. The stack overflow is fixed. But the install command still does not work (on a very simple package). Attached is the verbose output. It does not like to proceed somewhere between configure and build. But the verbose is not telling why!
I also attached my cabal dance with exactly the same configure options. ---- /home2/ecoin/garden> cabal install -v HTTP-Simple /home2/ecoin/ghc/bin/ghc --numeric-version looking for package tool: ghc-pkg near compiler in /home2/ecoin/ghc/bin found package tool in /home2/ecoin/ghc/bin/ghc-pkg /home2/ecoin/ghc/bin/ghc-pkg --version /home2/ecoin/ghc/bin/ghc -c /tmp/tmp26702.c -o /tmp/tmp26702.o /usr/bin/ld -x -r /tmp/tmp26702.o -o /tmp/tmp26703.o Reading installed packages... /home2/ecoin/ghc/bin/ghc-pkg list --global --user 'HTTP-Simple-0.1' is cached. Extracting /home2/ecoin/.cabal/packages/hackage.haskell.org/HTTP-Simple/0.1/HTTP -Simple-0.1.tar.gz to /tmp/TMPHTTP-Simple-0.1... Creating dist/setup (and its parents) /home2/ecoin/ghc/bin/ghc --make Setup.lhs -o dist/setup/setup -odir dist/setup - hidir dist/setup [1 of 1] Compiling Main ( Setup.lhs, dist/setup/Main.o ) Linking dist/setup/setup ... dist/setup/setup configure --verbose=2 --ghc --prefix=/home2/ecoin/htools --user
So at this point configuring the HTTP-Simple package is failing without any error message. That's not so good. :-)
cabal: Error: some packages failed to install: HTTP-Simple-0.1
So, for debugging, try configuring that package manually and see if the behaviour is the same and if so what the exit code is. Duncan
participants (3)
-
Chris Ball
-
Duncan Coutts
-
Steve Lihn