unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Pierre Neidhardt <mail@ambrevar.xyz>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 34807@debbugs.gnu.org
Subject: [bug#34807] [PATCH 1/2] Add (guix lzlib).
Date: Wed, 01 May 2019 18:46:44 +0200	[thread overview]
Message-ID: <87pnp2f7gr.fsf@ambrevar.xyz> (raw)
In-Reply-To: <8736ne3855.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]

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:

--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 ‘read!’ procedure must return an integer indicating the
     number of bytes read, or ‘0’ to indicate the end-of-file.
--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?.

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2019-05-01 16:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-10 18:02 [bug#34807] [PATCH 1/2] Add (guix lzlib) Pierre Neidhardt
2019-03-10 18:09 ` [bug#34807] [PATCH 2/2] dir-locals.el: Add 'call-with-lzip-input-port' and 'call-with-lzip-output-port' keywords Pierre Neidhardt
2019-03-22 21:35 ` [bug#34807] [PATCH 1/2] Add (guix lzlib) Ludovic Courtès
2019-05-01 16:46   ` Pierre Neidhardt [this message]
2019-05-02  9:16     ` Pierre Neidhardt
2019-05-04  9:11       ` Ludovic Courtès
2019-05-04 10:23         ` Pierre Neidhardt
2019-05-04 21:09           ` Ludovic Courtès
2019-05-04 21:39             ` Pierre Neidhardt
2019-05-06 21:18               ` Ludovic Courtès
2019-05-06 23:28                 ` Tobias Geerinckx-Rice
2019-05-07  7:02                   ` Pierre Neidhardt
2019-05-07 15:44                     ` bug#34807: " Ludovic Courtès
2019-05-07 15:51                       ` [bug#34807] " Pierre Neidhardt
2019-05-07  8:19                   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pnp2f7gr.fsf@ambrevar.xyz \
    --to=mail@ambrevar.xyz \
    --cc=34807@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).