
On Sat, May 8, 2010 at 3:42 PM, Brandon S. Allbery KF8NH
On May 8, 2010, at 08:49 , Gwern Branwen wrote:
On Fri, May 7, 2010 at 11:42 PM, Brandon S. Allbery KF8NH
wrote: On May 7, 2010, at 17:00 , Gwern Branwen wrote:
"-outputdir dir
The -outputdir option is shorthand for the combination of -odir, -hidir, and -stubdir."
So if we used "-outputdir /dev/null", we don't have to worry about
I expect you'll get a "Not a directory" diagnostic from GHC about that one, unless GHC itself special-cases /dev/null.
Bleh, unfortunately it doesn't seem to.
'/dev/null/Main.o: getModificationTime: inappropriate type (Not a directory)'
Do you know of any similar directories we could use in place of /dev/null?
No; and in any case, I don't think you could get away with it because ghc is using those .hi and .o files internally (including passing the .o files to ld), so they have to go *somewhere*. And Unix doesn't have the notion of a temporary directory that goes away when the creating process exits, as it has for files (the open-and-unlink idiom); and there are problems with providing one.
I think what you really want is for ghc to have a treat-intermediate-files-in-this-session-as-ephemeral flag, such that the .hi and .o files created during a ghc invocation are removed after the link step.
Yes, I'm giving up on this one and punting it to GHC HQ. There just doesn't seem to be any satisfactory way for us to do it, short of shelling out to 'find'. The bug report is http://hackage.haskell.org/trac/ghc/ticket/4114 if anyone wants to cc themselves (remember, CCs are like votes! except they count even less). -- gwern