#2201: "ghc-pkg --user describe '*'" fails with empty user db
----------------------+-----------------------------------------------------
 Reporter:  duncan    |          Owner:             
     Type:  bug       |         Status:  new        
 Priority:  low       |      Milestone:  6.10 branch
Component:  Compiler  |        Version:  6.9        
 Severity:  normal    |     Resolution:             
 Keywords:            |     Difficulty:  Unknown    
 Testcase:            |   Architecture:  Unknown    
       Os:  Unknown   |  
----------------------+-----------------------------------------------------
Comment (by duncan):

 Though I should note that we need to have this fixed in the 6.10 release
 or Cabal will not play nicely with it. The workaround is quite horrible.

 So the question is, how should we get the info from ghc-pkg, bearing in
 mind that in future we expect the package databases to be really quite
 large, in the 100's of packages.

 In some ways the current system cabal-install uses for the hackage package
 index is quite nice. It loads the entire index into memory but it does not
 parse each entry immediately. Instead it does that lazily so that if we
 only inspect a small number of the packages then it's quite cheap.

 I think we could do a similar trick with ghc-pkg. If it can dump all the
 info to stdout sufficiently quickly (even for large databases) then so
 long as we can identify each record without parsing the whole thing then
 we can probably make it quick enough.

 Splitting just based on seeing "\nname:" is probably quick enough and is
 probably unambiguous. Or we could consider using some other way to
 delineate records.

 So on balance I think `ghc-pkg dump` is a sensible way to go, though I'd
 prefer a better way of identifying record boundaries.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2201#comment:3>
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