guix-patches
[Top][All Lists]
Advanced

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

[bug#52555] [RFC PATCH v2 2/5] publish: Add ERIS URN to narinfo


From: Maxime Devos
Subject: [bug#52555] [RFC PATCH v2 2/5] publish: Add ERIS URN to narinfo
Date: Sat, 29 Jan 2022 22:15:35 +0100
User-agent: Evolution 3.38.3-1

pukkamustard schreef op di 25-01-2022 om 19:21 [+0000]:
> +  (define (eris-encode-nar compressions)
> +    (and (member %eris-zstd-compression compressions)
> +         (let* ((nar (nar-cache-file cache item
> +                                     #:compression %eris-zstd-compression))
> +                (stat (stat nar #f)))
> +           (and stat
> +                (call-with-input-file nar
> +                  (cut eris-encode->string <>
> +                       #:block-size %eris-block-size-large))))))

Why are exceptions turned into #f (in (stat nar #f))?
Should this be done for all I/O errors, including, say, EOVERFLOW,
ENOMEM or ENAMETOOLONG, or only for ENOENT?

Is a race condition possible here?  If so, maybe consider doing
something like

  (catch 'system-error
    (lambda () (call-with-input-file ...))
    (lambda exception
      (and it-is-a-ENOENT
           (apply throw exception))))

to avoid it?

Greetings,
Maxime.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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