Subject: bug#57978: [PATCH 2/2] substitute: Retry downloading when a nar is unavailable.

From: Ludovic Courtès <[email-masked]>
Date: Sat, 24 Sep 2022 18:20:08 +0200

Hi!

zimoun <[email-masked]> skribis:

>> +  (with-narinfo*
>> +      (string-append %narinfo "Signature: "
>> +                     (signature-field
>> +                      %narinfo
>> +                      #:public-key %wrong-public-key))
>> +      %main-substitute-directory
>> +
>> +    (with-http-server `((200 ,(string-append %narinfo "Signature: "
>> +                                             (signature-field
>> +                                              %narinfo
>> +                                              #:public-key %wrong-public-key)))
>> +                        (404 "Sorry, nar is missing!"))
>> +      (let ((url1 (%local-url)))
>> +        (parameterize ((%http-server-port 0))
>> +          (with-http-server `((200 ,(string-append %narinfo "Signature: "
>> +                                                   (signature-field %narinfo)))
>> +                              (404 "Sorry, nar is missing!"))
>> +            (let ((url2 (%local-url)))
>> +              (dynamic-wind
>> +                (const #t)
>> +                (lambda ()
>> +                  (parameterize ((substitute-urls
>> +                                  (list url1 url2
>> +                                        (string-append "file://"
>> +                                                       %main-substitute-directory))))

[...]

> Although I do not understand this test.  Why is 404 appearing twice?

That’s because it’s testing with 3 substitute URLs.

Thanks for taking a look!

Ludo’.