Subject: bug#57559: guix pull fails on http status code 503

From: Maxime Devos <[email-masked]>
Date: Thu, 8 Sep 2022 13:29:38 +0200

On 08-09-2022 13:11, zimoun wrote:
> Hi Maxime,
>
> On Thu, 08 Sep 2022 at 11:23, Maxime Devos <[email-masked]> wrote:
>
>> Looking at 'latest-channel-instances', the code for deciding what the
>> latest version is, is the same for the guix channel and any other
>> channel.  As such, the 'Guix is unavailable' is, currently, not special.
> Well, ’latest-channel-instances’ relies on ’latest-channel-instance’
> which tests ’guix-channel?’,
>
> --8<---------------cut here---------------start------------->8---
> (define (guix-channel? channel)
>    "Return true if CHANNEL is the 'guix' channel."
>    (eq? 'guix (channel-name channel)))
> --8<---------------cut here---------------end--------------->8---
That's only for channel authentication and patches, not relevant for 
this bug#57559.
> then, for instance, the occurrences are:
>
> --8<---------------cut here---------------start------------->8---
> 12 candidates:
> ./guix/channels.scm:79:            guix-channel?
> ./guix/channels.scm:192:(define (guix-channel? channel)
> ./guix/channels.scm:199:  (if (and (guix-channel? chan)
> ./guix/channels.scm:424:            (when (guix-channel? channel)
> ./guix/channels.scm:437:    (when (guix-channel? channel)
> ./guix/channels.scm:778:            (guix-channel? (channel-instance-channel instance)))
> ./guix/channels.scm:903:        (item (if (guix-channel? channel)
> ./guix/scripts/pull.scm:775:        (match (find guix-channel? channels)
> ./guix/scripts/pull.scm:788:                   (remove guix-channel? channels))))
> ./gnu/packages/package-management.scm:125:                                guix-channel?
> ./gnu/packages/package-management.scm:618:   (delay (match (or (find guix-channel? (current-channels))
> ./gnu/ci.scm:478:    (find guix-channel? channels))
> --8<---------------cut here---------------end--------------->8---
>
> And my point is that the Guix channel is special when pulling.
It is special for some things, yes, but it isn't special for deciding
what is the latest version. These occurrences are for channel 
authentication,
patching, building, Cuirass and the 'guix' package, not for deciding
what is to be considered the latest available version of the channel
> Therefore, we could split the cases when the Guix channel is unreachable
> and when other extra-channels are unreachable; because the impact are
> different, IMHO.
In principle, we could, but I don't see the point. Solving things for 
the case
where the unavailable channel is Guix is no more complicated than for other
channels.
> As I pointed earlier in the thread, the main issue is when these extra
> channels are unreachable; as André have initially reported.
This might be the main issue, yes, but I still don't see the point of 
treating
'guix' specially for the puposes of #57559.  It would make the semantics of
"guix pull" and its implementation more complex, for no apparent purpose
AFAICT (solving the general issue would solve the main issue, right?).

About the complexity of the implementation: as mentioned previously,
latest-channel-instances doesn't treat the Guix channel specially
(the authentication check and patches isn't relevant here), so adding an
additional (if (guix-channel?) ...) would add complexity (and hence, require
additional testing and maybe documentation).

Greetings,
Maxime.