[GHC] #12053: Mode for ghc --make which only compiles the files I pass on command line

#12053: Mode for ghc --make which only compiles the files I pass on command line -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: backpack | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Here are a few situations where GHC picks up "too many" files when running `--make`: * Suppose a user doesn't add enough modules to `exposed-modules`/`other- modules` in Cabal. GHC will happily pick up extra source files, but those files won't get bundled in the `sdist` or be included in ABI computation. Difficult for Cabal to tell when this has happened. * Suppose the user wants to define multiple internal libraries, and give them the same hs-source-dir. This won't work: because GHC sees the source file it will prefer it over the external dependency. There's a very easy thing that GHC could do to make this better: add a mode to `--make` which says "only compile the files that are explicitly passed on the command line." Something like `ghc --make --only A.hs` will only build A.hs, and error if you try to import B.hs. Seems like this should be fairly easy to do, and would help solve a lot of problems related to GHC slurping up too many files. (I've assigned myself because this is a blocker for backpack, but if someone wants to take a crack at this be my guest.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12053 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12053: Mode for ghc --make which only compiles the files I pass on command line -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: backpack 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 mgsloan): Something like this would indeed be handy! The linker errors people get when the module isn't in their cabal file can be scary / uninformative. FYI, the approach that stack takes here is to use `-ddump-hi` and identify when there are modules / etc unmentioned in the cabal file. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12053#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12053: Mode for ghc --make which only compiles the files I pass on command line -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | 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): Wiki Page: | -------------------------------------+------------------------------------- Changes (by ezyang): * keywords: backpack => -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12053#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC