GNU bug report logs - #57978
'guix substitute' stops when first substitute URL is unroutable

Previous Next

Package: guix;

Reported by: Attila Lendvai <attila <at> lendvai.name>

Date: Wed, 21 Sep 2022 13:12:02 UTC

Severity: important

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Maxime Devos <maximedevos <at> telenet.be>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 58017 <at> debbugs.gnu.org, 57978 <at> debbugs.gnu.org, Attila Lendvai <attila <at> lendvai.name>, zimoun <zimon.toutoune <at> gmail.com>
Subject: bug#57978: [bug#58017] [PATCH 2/2] substitute: Retry downloading when a nar is unavailable.
Date: Sat, 24 Sep 2022 19:18:15 +0200
[Message part 1 (text/plain, inline)]

On 24-09-2022 18:22, Ludovic Courtès wrote:
> Hi Maxime,
> 
> Maxime Devos <maximedevos <at> telenet.be> skribis:
> 
>>> +(test-equal "substitute, first URL has narinfo but nar is 404, both URLs authorized"
>>> +  "Substitutable data."
>>> +  (with-narinfo*
>>> +      (string-append %narinfo "Signature: "
>>> +                     (signature-field %narinfo))
>>> +      %main-substitute-directory
>>> +
>>> +    (with-http-server `((200 ,(string-append %narinfo "Signature: "
>>> +                                             (signature-field %narinfo)))
>>> +                        (404 "Sorry, nar is missing!"))
>>> +      (dynamic-wind
>>> +        (const #t)
>>> +        (lambda ()
>>> +          (parameterize ((substitute-urls
>>> +                          (list (%local-url)
>>> +                                (string-append "file://"
>>> +                                               %main-substitute-directory))))
>>> +            (request-substitution (string-append (%store-prefix)
>>> +                                                 "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
>>> +                                  "substitute-retrieved"))
>>> +          (call-with-input-file "substitute-retrieved" get-string-all))
>>> +        (lambda ()
>>> +          (false-if-exception (delete-file "substitute-retrieved")))))))
>>
>> Shouldn't it only ignore 'file not found' (ENOENT?) exceptions?
> 
> By “it”, do you mean ‘dynamic-wind’ should be replaced by a ‘catch’
> form?

No, I'm not referring to the dynamic-wind as a whole, rather 'it' = the 
following code:

 (false-if-exception (delete-file "substitute-retrieved"))

-- the catch can stay, AFAIK.

> We could discuss it, but note that this patch just keeps with the style
> of existing tests.

For the reasons given, I don't think this style should be continued, 
though I suppose all of them can be done at once in a separate patch.

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

This bug report was last modified 2 years and 288 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.