[GHC] #10741: add flag to dump module and package dependencies
GHC
ghc-devs at haskell.org
Wed Aug 5 21:04:33 UTC 2015
#10741: add flag to dump module and package dependencies
-------------------------------------+-------------------------------------
Reporter: elaforge | Owner:
Type: feature | Status: new
request |
Priority: normal | Milestone:
Component: Compiler | Version:
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Revisions: |
-------------------------------------+-------------------------------------
You can already dump module and package dependencies with -M -include-pkg-
deps, but it wants to modify a Makefile, so it's not so convenient for
things that are not make. For other build systems, it would be convenient
to get this on stdout in an easily parseable form. Say X/A.hs imports
Y/B.hs, which imports Z/C.hs, and they all use package 'base' and
'containers':
{{{
% ghc -Mstdout X/A.hs
X/A.h
Y/B.hs
Y/B.hs
Z/C.hs
base containers
%
}}}
I don't know about what the output format should be, but assuming no
newlines in filenames, and package names never have spaces, it seems
simplest to do something like:
[src ++ "\n" ++ dest ++ "\n" | (src, dest) <- moduleDeps]
++ "\n" ++ unwords packageDeps
It could use haskell syntax like --info, but then you'd need a full
haskell parser just to read it, which is not a problem for shake, but
probably inconvenient for other build systems.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10741>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list