#2201: "ghc-pkg --user describe '*'" fails with empty user db
------------------------+---------------------------------------------------
    Reporter:  duncan   |       Owner:          
        Type:  bug      |      Status:  new     
    Priority:  normal   |   Component:  Compiler
     Version:  6.9      |    Severity:  normal  
    Keywords:           |    Testcase:          
Architecture:  Unknown  |          Os:  Unknown 
------------------------+---------------------------------------------------
 With ghc 6.9 and later Cabal uses the new "`ghc-pkg describe '*'`"
 interface to get info out of `ghc-pkg` about all the installed packages.
 It makes one call for each package db, for `--global` and `--user` (and
 any other dbs the user specifies). The `--user` flag now means to list
 only the packages from the user db and not the ones from the global one
 too. It's quite possible that the user package db is empty (or
 equivalently that the file does not exist yet).

 So what goes wrong is that the new search feature treats an empty search
 result as a failure. That's obviously a useful thing for some queries but
 is extremely unhelpful for what Cabal wants. It means Cabal fails to
 configure anything when the user package db is empty because it does not
 expect ghc-pkg to fail. This blocks the current Cabal HEAD from working
 with ghc HEAD.

 I'd like to put in another request for the `ghc-pkg dump` feature that I
 suggested originally. It would just dump all the packages in the
 `describe` format. The difference is that it is not a query so we do not
 fail if the result set is empty. Also, `dump` should not produce helpful
 human readable error output like "{{{ghc-pkg: cannot find package matching
 *}}}" because that will upset Cabal's parser.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2201>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to