Please export GhcMake.downsweep and make it return a partial module graph in case of errors
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.
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.2 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |