From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:56042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLsOr-0007vB-7z for guix-patches@gnu.org; Wed, 01 May 2019 12:48:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLsOo-0001M6-6H for guix-patches@gnu.org; Wed, 01 May 2019 12:48:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59433) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hLsOo-0001LO-2h for guix-patches@gnu.org; Wed, 01 May 2019 12:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hLsOn-0007gh-SO for guix-patches@gnu.org; Wed, 01 May 2019 12:48:01 -0400 Subject: [bug#34807] [PATCH 1/2] Add (guix lzlib). Resent-Message-ID: From: Pierre Neidhardt In-Reply-To: <8736ne3855.fsf@gnu.org> References: <20190310180209.11578-1-mail@ambrevar.xyz> <8736ne3855.fsf@gnu.org> Date: Wed, 01 May 2019 18:46:44 +0200 Message-ID: <87pnp2f7gr.fsf@ambrevar.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 34807@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, thanks for the review. I've worked on it and I've managed to address almost all issues. Now I'm stuck with the stream decompression. Lzip expects some special terminating bytes for each member. In tests/lzlib.scm, we produce a compressed stream and decompress it in parallel. But more often than not, before the compression is done, the decompression will exhaust the port's byte and terminate prematurely. I don't know what to do in this case. From the Guile manual: =2D-8<---------------cut here---------------start------------->8--- -- Scheme Procedure: make-custom-binary-input-port id read! get-position set-position! close Return a new custom binary input port(1) named ID (a string) whose input is drained by invoking READ! and passing it a bytevector, an index where bytes should be written, and the number of bytes to read. The =E2=80=98read!=E2=80=99 procedure must return an integer in= dicating the number of bytes read, or =E2=80=980=E2=80=99 to indicate the end-of-fi= le. =2D-8<---------------cut here---------------end--------------->8--- The decompression will sometime decompress 0 byte (when it's faster then the compression). But if I return 0 in lzread!, then the custom port will be closed too early, before we could decompress the terminating bytes. Is there a way to wait on the port instead of reading 0 bytes? Note that lzip can test whether the decompressed stream is terminated or not with lz-decompress-member-finished?. =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlzJzXQACgkQm9z0l6S7 zH9DHwf/f18i31x68XJTME8Z2Tcy13hblXWurKUUbOUshDslmqLlydtO4nm+Twsq qs7JbN9uZwW5zbFYkwS/1O3COGWWx4m1DpScdzwBPPkY1cQn8RLq5cwe4BJJW8tK ElgGZrP2OlR5r4G0z/w5sw5kFZneUXqgv+6Dejkkvo0j+NhRlr2v6FTFZt7oekJY fUBDX0GUMAuPhQMO0Fsq17SfIIqY7mX4ARGINXCOy3Aoa2O7odqxgAxb9Gxo6U6E qBbpWmqvrFDl7CgFN4S1UH9w2PxqJcvIb429SUxcORxdKNNSmWXJROCUroiHEctB Q0YcKbPWBGVFInlLwv+x6neJxLKTrw== =FUaa -----END PGP SIGNATURE----- --=-=-=--