[GHC] #12485: -package-db flags now need to be sorted by dependency order

GHC ghc-devs at haskell.org
Sat Oct 8 09:45:08 UTC 2016


#12485: -package-db flags now need to be sorted by dependency order
-------------------------------------+-------------------------------------
        Reporter:  niteria           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.3
       Component:  Package system    |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  phab:D2450,
       Wiki Page:                    |  phab:D2514
-------------------------------------+-------------------------------------

Comment (by simonmar):

 Ok, I'm still trying to get my head around this problem.  Here's the
 algorithm I want to use:

  * for each package DB
    * add packages one by one to an accumulating `Map PackageId (Maybe
 Package)`
    * if we encounter a `PackageKey` that we already have:
      * If the ABIs are the same, replace the old one by the new one
      * If the ABIs are different, insert a `Nothing` entry in the map (and
 report an error with -v2)
      * If we already have a `Nothing` for this `PackageKey`, leave it as
 `Nothing` (and report an error with -v2)
  * Afterwards, remove any package from the DB with one or more missing
 dependencies, recursively until you can remove no more packages. (report
 what we're doing with -v2)

 Does anything go wrong with this?  It's a slight variant of the algorithm
 that we used before `PackageKey`s I think.

 When we have dependencies that specify ABIs we can refine this to be more
 intelligent about what to throw away, but in the meantime I think this
 will be fine.  It's very similar to what we used to do.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12485#comment:28>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list