guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 01/01: guix: Simplify and robustify lzread!.


From: Pierre Neidhardt
Subject: Re: 01/01: guix: Simplify and robustify lzread!.
Date: Wed, 08 May 2019 12:40:45 +0200

Ludovic Courtès <address@hidden> writes:

> Hi Pierre!
>
> address@hidden skribis:
>
>> commit ecfc54403e2a1934b4f6e84ddad429b7970091fa
>> Author: Pierre Neidhardt <address@hidden>
>> Date:   Tue May 7 18:40:40 2019 +0200
>>
>>     guix: Simplify and robustify lzread!.
>       ^
> Should be lzlib.

Oops!
I must confess that I never really understood the whole logic behind
GNU-style commit message :p

>>     * guix/lzlib.scm (lzread!): Do it.
>>     
>>     Previously lzread! would fail if COUNT was bigger
>>     than (lz-decompress-write-size).  This is possible if a previous call to
>>     lzread! didn't empty the LZ_decompress input buffer (e.g. BV was too 
>> small to
>>     fit all the data).
>
> Could you add a test for this corner case?  It’s corner cases like that
> that can spoil the whole experience, so it feels safer to add tests as
> soon as we encounter them.  :-)

I would have, but I don't know how.  The problem is that I don't control
the chunk size passed to the read! callback of the custom port.  That's
all up to Guile's implementation of custom ports.

In practice, it seems that the BV is always big enough so the potential
issue can never arise.  But the new code is better on all aspects.

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]