[darcs-devel] darcs patch: Remove some use of GHC internals and fix... (and 11 more)

David Roundy droundy at abridgegame.org
Tue Apr 5 05:03:53 PDT 2005


On Sun, Apr 03, 2005 at 03:46:46PM +0100, Ian Lynagh wrote:
> On Sun, Apr 03, 2005 at 09:55:33AM -0400, David Roundy wrote:
> > 
> > The making FastPackedString portable patch scared me, so I didn't apply
> > it either.  It had just enough #ifdefs in it that I couldn't see from
> > looking at it exactly what was being done.  I'd prefer configure tests
> > and Workaround.hs (if necesary) rather than #ifdefs, unless there's a
> > good reason for the #ifdefs.
> 
> The problem is hugs doesn't have Foreign.Concurrent.newForeignPtr
> and I couldn't see a sane way to do
>     newForeignPtr p (do {c_munmap p l; return (); })
> without it.
> 
> We could make a finaliser and use Foreign.ForeignPtr.newForeignPtr to do
> the munmap, but then that finaliser would need to be freed after it had
> been run.
> 
> So the ifdefs only try to do mmapping when __GLASGOW_HASKELL__ is
> defined. I don't think this can be done more nicely, other than using a
> HAS_MMAP symbol instead of __GLASGOW_HASKELL__. I guess you might prefer
> a dummy Foreign.Concurrent.newForeignPtr that just returns an error
> coupled with use_mmap to not try calling it.

I see.  That's not so bad, although I do think there's got to be a cleaner
way.  Probably defining a HAS_MMAP is the way to go.  Or maybe the other
scheme would be better...

> > It definitely seems worthwhile to get configure tests written that will
> > work with hugs.  Is anyone interested (from what you say about hoping
> > someone else will volunteer for the autoconf magic, I'm guessing it's
> > not you, Ian) in volunteering to maintain the darcs hugs port?
> 
> Once the autoconf stuff is done it shouldn't really need much
> maintainence. Just have the darcs check script try to compile/load in
> hugs and that will catch regressions. It should also be possible to run
> the tests with the hugs darcs, but that would probably be too painful to
> do by default.

Hmmm.  Okay.  Except that this would require everyone running check have
hugs installed... I guess as long as we have a separate test_nohugs target,
that'd be fine.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list