[GHC] #10741: add flag to dump module and package dependencies

#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

#10741: add flag to dump module and package dependencies -------------------------------------+------------------------------------- Reporter: elaforge | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by thomie): You could write your own **Frontend plugin** for this: https://github.com/ghc/ghc/commit/a3c2a26b3af034f09c960b2dad38f73be7e3a655. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10741#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC