[darcs-users] darcs patch: resolve issue784: fix file handle leak and check for exceptions on process running.

David Roundy droundy at darcs.net
Tue Oct 21 10:21:09 UTC 2008

On Mon, Oct 20, 2008 at 08:08:41AM +0200, Salvatore Insalaco wrote:
> I'm sorry for not using darcs send: unfortunately my mail are blocked
> by the mailing list spam filter.
> This patch should hopefully fix issue 784 (Windows complaining while
> paging the help).
> There where three things involved:
> 1) There is a file handle leak in pipeDocToPager when an exception is
> raised. This is the direct cause of the "permission denied" errors, as
> you can't delete an opened file in Windows.
> 2) ortryrunning doesn't check for exceptions: in Windows a failed
> runProcess returns an exception.
> 3) runProcess on Windows require explicit ".com" suffix for .com
> executables. We should add "more.com" to the list of possible pagers.

Looks good! It's going in, once tests are passed.  :)

This is one of the many places where things will be far better with the new
System.Process.  It's seriously stupid that we're forced to write a
temporary file just so stdout will be inherited.

> By the way: a bit thank you to David for Franchise. I finally managed
> to compile and patch darcs under Windows installing only GHC and a
> couple of Haskell libraries (HTTP and zlib, required by cabal too). No
> MinGW, no Cygnus. Surely we could improve the build process (the
> configure step before every compilation is a bit annoying), but this
> is a huge step forward.

You're welcome!

Setup.hs shouldn't be reconfiguring before each compilation (unless you
touch Setup.hs itself.  This sounds like a bug... Can you try demonstrating
it with the latest franchise and darcs, and send in the build.log? (You can
interrupt after the compile begins to keep the build.log from being too
David Roundy

More information about the darcs-users mailing list