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

GHC ghc-devs at haskell.org
Thu May 12 19:55:51 UTC 2016


#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


More information about the ghc-tickets mailing list