[GHC] #10887: Please export GhcMake.downsweep and make it return a partial module graph in case of errors

GHC ghc-devs at haskell.org
Wed Sep 16 08:09:26 UTC 2015


#10887: Please export GhcMake.downsweep and make it return a partial module graph
in case of errors
-------------------------------------+-------------------------------------
              Reporter:  DanielG     |             Owner:
                  Type:  feature     |            Status:  new
  request                            |
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.10.2
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
             Test Case:              |        Blocked By:
              Blocking:              |   Related Tickets:
Differential Revisions:              |
-------------------------------------+-------------------------------------
 Hi,

 in ghc-mod we have to essentially run a downsweep before we have any idea
 what
 `-package` flags to pass to GHC. We do this in order to figure out which
 modules
 belong to each Cabal component. If we use `depanal` to do this it will
 unfortunately just throw import errors because we haven't actually told
 GHC
 which package should be in scope yet.

 I think depanal/downsweep also abort on some other types of errors, which
 would also have to be cought since ghc-mod needs to work even when there
 are modules with parse errors etc (because the user is still editing
 them).

 I'm not sure where ghc parses the module headers so I'm not sure if it's
 going
 to blow up horribly when a module header doesn't parse or if that's just
 going
 to make downsweep return failure too.

 For the time being we essentially just re-implemented downsweep's
 functionality
 .. poorly but I'd really rather use downsweep directly.

 Thanks.

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


More information about the ghc-tickets mailing list