Ticket #4114 (new feature request)

Opened 3 years ago

Last modified 5 months ago

Add a flag to remove/delete intermediate files generated by GHC

Reported by: guest Owned by:
Priority: low Milestone: 7.6.2
Component: Compiler Version: 6.10.4
Keywords: Cc: gwern0@…, merehap@…, tafryn@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets: #2258

Description

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?

Change History

Changed 3 years ago by merehap

  • cc merehap@… added

Changed 3 years ago by claus

see also #2258

Changed 3 years ago by maltem

Not really related to this bug report, but: As for xmonad, the UI problem here is that xmonad puts generated files into its config/source directory. E.g. dyre puts those below $XDG_CACHE_HOME by default.

Changed 3 years ago by waern

Would also be useful for clients of the GHC API. See e.g.  http://trac.haskell.org/haddock/ticket/135.

Changed 3 years ago by igloo

  • milestone set to 6.16.1

Changed 3 years ago by tafryn

  • cc tafryn@… added

Changed 3 years ago by igloo

See also #2258

Changed 16 months ago by igloo

  • priority changed from normal to low
  • milestone changed from 7.4.1 to 7.6.1

Changed 9 months ago by igloo

  • milestone changed from 7.6.1 to 7.6.2

Changed 5 months ago by morabbin

  • related set to 2258

Changed 5 months ago by morabbin

  • related changed from 2258 to #2258
Note: See TracTickets for help on using tickets.