[GHC] #4114: Add a flag to remove/delete intermediate files generated by GHC

GHC cvs-ghc at haskell.org
Wed Jun 2 17:37:46 EDT 2010


#4114: Add a flag to remove/delete intermediate files generated by GHC
---------------------------------+------------------------------------------
    Reporter:  guest             |       Owner:              
        Type:  feature request   |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  6.10.4            |    Keywords:              
          Os:  Unknown/Multiple  |    Testcase:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 See for example http://stackoverflow.com/questions/1411089/how-to-stop-
 ghc-from-generating-intermediate-files or
 http://www.haskell.org/pipermail/xmonad/2010-May/010180.html /

 Currently GHC generates *.o and *.hi files for executables, possibly quite
 a few. They take up space, filenames, and interfere with tab-completion.

 (And they may be worse than that. I occasionally see users in #xmonad who
 seem to have subtle compilation issues after upgrades linked to stale .hi
 and .o files.)

 There doesn't seem to be any good way to remove the intermediates for a
 program like Xmonad. They can't be redirected to /dev/null, it's a
 potential security problem to redirect them to /tmp, and removing them
 manually is difficult (Xmonad could hardwire in removeFiles of 'xmonad.o'
 and 'xmonad.hi', but what about the arbitrary user modules in
 ~/.xmonad/lib? Now one needs to start working with globs or utilities like
 'find'...).

 Of course, GHC knows precisely what's being generated, and could easily
 remove them. So another flag in the line of -fforce-recompilation seems
 warranted; perhaps -fforce-no-intermediates?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4114>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list