Ticket #204 (closed defect: fixed)

Opened 1 year ago

Last modified 9 months ago

should setting user-prefix in ~/.cabal/config work?

Reported by: guest Assigned to:
Priority: normal Milestone: Cabal-1.4
Component: cabal-install tool Version: HEAD
Severity: normal Keywords:
Cc: Difficulty: normal
GHC Version: 6.8.2 Platform: Linux

Description

Setting user-prefix in .cabal/config leads to the following error:

wolverian@puni:~$ cabal info xmonad
Warning: Error parsing config file /home/wolverian/.cabal/config: On line 5: Parse of field 'prefix' failed: 
Warning: Using default configuration.

I don't think the file format is documented anywhere, but a bit of poking in the source and a Google led me to believe that this should work.

My config file looks like this:

wolverian@puni:~$ cat .cabal/config
compiler: GHC
repos: hackage.haskell.org:http://hackage.haskell.org/packages/archive
cachedir: "/home/wolverian/.cabal/packages"
user-install: true
user-prefix: "/home/wolverian"
hackage-username: ""
hackage-password: ""

This is with up-to-date (as of today) Cabal and cabal-install from Darcs:

wolverian@puni:~$ cabal --version
cabal-install version 0.4.1
using version 1.3.2 of the Cabal library 

And my GHC is a local (in ~) GHC 6.8.2:

wolverian@puni:~$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.8.2

-- wolverian
ilmari.vacklin@cs.helsinki.fi

Change History

01/05/08 21:59:41 changed by guest

  • version changed from 1.2.3.0 to HEAD.

01/06/08 05:22:23 changed by duncan

That is indeed supposed to work. We'll have to investigate.

01/12/08 10:06:45 changed by duncan

Ah, I see. The problem is that user-prefix: does work and just prefix: does not. That's a recent unintentional change. So the default config file that was generated previously that used just prefix: is now getting rejected.

01/14/08 04:11:42 changed by guest

The version I was running at the time of reporting rejected both forms. I'll try upgrading to the latest Darcs soon.

01/24/08 07:58:08 changed by duncan

  • milestone set to Cabal-1.4.

03/12/08 06:59:19 changed by duncan

  • status changed from new to closed.
  • resolution set to fixed.

It's working for me with the current darcs version so long at the user-prefix path is quoted. In your example you do have it quoted so I don't know what problem you ran into exactly. I'm changing that to be consistent with the .cabal format which allows quoted or unquoted paths.

The error in the error message, that it reports "prefix" rather than "user-preifx" is an artifact of the current config parser that I don't intend to fix because the whole thing is going to be replaced shortly.

If you still see this problem, reopen this ticket.