[xmonad] Re: darcs patch: XMonad.Core: rw recompilation

Gwern Branwen gwern0 at gmail.com
Thu May 13 17:02:40 EDT 2010


2010/5/9 Tomáš Janoušek <tomi at nomi.cz>:
> Hello,
>
> On Sat, May 08, 2010 at 05:02:40PM -0400, Brandon S. Allbery KF8NH wrote:
>> ghc's only going to get confused if they're removed *during* compilation.
>> Otherwise, the worst that happens is ghc has to recreate them during
>> xmonad --recompile
>
> But those .o files stay there, don't they? What happens if a second user
> --recompiles and ghc can't rewrite/delete those files due to ownership?

That's a good point; I hadn't thought of the name conflict. Between
that and Brandon's security point (ghc might not reuse those files
depending on how it checks for existing files, and one could probably
solve it by forcing recompilation), I guess this isn't a good idea;
I've marked it rejected on darcswatch.

So, we could either wait until GHC implements and widely releases some
-remove-intermediates option, or we could just go with Joachim's old
strategy of manually removing the intermediates in .xmonad/:
http://darcswatch.nomeata.de/bundles/8e8ad2f4b141e33c06490e60b15f3191f84a5cc0.dpatch

+       hi   = base ++ ".hi"
+       o    = base ++ ".o"
        lib  = dir </> "lib"
    libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib
    srcT <- getModTime src
hunk ./XMonad/Core.hs 424
      then do
        -- temporarily disable SIGCHLD ignoring:
        uninstallSignalHandlers
+       -- remove old interface files, just in case ghc6 was upgraded
and does not
+       -- like the new ones. Ignore any errors while doing so.
+       try $ removeFile hi
+       try $ removeFile o

So. Thoughts on *that*?

--
gwern


More information about the xmonad mailing list