Re: hashed-storage vs. mmap
twb@cybersource.com.au (Trent W. Buck) writes:
> Joachim Breitner <nomeata@debian.org> writes:
>
>> [darcs 2.4 wants hashed-storage 0.3.x
>> hashed-storage 0.3.x wants mmap 0.4.x
>> debian has mmap 0.5.x (too new)]
>>
>> We have some options now:
>>
>> a) Upload mmap-0.4.1 again, using an epoch bump.
>> b) Introduce an haskell-mmap4 source package and libghc6-mmap4-* binary
>> packages until hashed-storage uses 0.5.4
>> c) Backport the mmap-0.5-compatibility patch from the hashed-storage
>> 0.4 series and apply that locally.
>>
>> Personally, I prefer c) over b) over a). Trent, you are the darcs
>> maintainer, I guess it’s up to you.
>
> I'd like to defer this decision to Petr Rockai, since he'll have the
> best understanding of how Darcs and hashed-storage interact and thus
> whether (c) is the Right Thing or the Wrong Thing.
>
> My preference is for (c) if it's the Right Thing.
I spoke to Petr about it. At the time, there weren't any versions of
hashed-storage that worked with mmap-0.5, but he wrote and tested a
trivial patch (below) which passes hashed-storage's regression tests.
I guess you just quilt import this into an h-s 0.3.9 debian/. Darcs
2.3.1 also has a 0.4 ceiling for mmap (an optional build-dep), but I'm
told I can just bump this.
Note that darcs 2.4rc2 depends on hashed-storage >= 0.4.7 && < 0.5, and
2.4 is due for release in weeks (days?), so I haven't been worrying too
much about Darcs 2.3.1 and h-s 0.3.9.
I'm sorry I'm not making much time to help with Darcs' deps. When I
adopted Darcs it had simpler deps and I just assumed someone else would
take care of them.
diff -rN -u -p old-hashed-storage/hashed-storage.cabal new-hashed-storage/hashed-storage.cabal
--- old-hashed-storage/hashed-storage.cabal 2010-02-23 07:33:04.000000000 +0100
+++ new-hashed-storage/hashed-storage.cabal 2010-02-23 07:33:04.000000000 +0100
@@ -73,7 +73,7 @@ library
dataenc,
binary,
zlib,
- mmap >= 0.4 && < 0.5
+ mmap >= 0.5 && < 0.6
c-sources: Bundled/sha2.c
diff -rN -u -p old-hashed-storage/Storage/Hashed/Index.hs new-hashed-storage/Storage/Hashed/Index.hs
--- old-hashed-storage/Storage/Hashed/Index.hs 2010-02-23 07:33:04.000000000 +0100
+++ new-hashed-storage/Storage/Hashed/Index.hs 2010-02-23 07:33:04.000000000 +0100
@@ -213,8 +213,8 @@ mmapIndex indexpath req_size = do
if req_size > 0 then fromIntegral req_size else act_size
case size of
0 -> return (castForeignPtr nullForeignPtr, size)
- _ -> do (x, _) <- mmapFileForeignPtr indexpath
- ReadWrite (Just (0, size + size_magic))
+ _ -> do (x, _, _) <- mmapFileForeignPtr indexpath
+ ReadWriteEx (Just (0, size + size_magic))
return (x, size)
data IndexM m = Index { mmap :: (ForeignPtr ())
Reply to: