Subject: [bug#45409] [PATCH v3 3/3] guix: Split (guix substitutes) from (guix scripts substitute).

From: Ludovic Courtès <[email-masked]>
Date: Mon, 11 Jan 2021 14:26:26 +0100

Hi,

Christopher Baines <[email-masked]> skribis:

>> I’m reluctant starting this new module while it still contains
>> single-short-lived-process assumptions (connection caching & co.).
>>
>> How about proceeding like this:
>>
>>   1. Move ‘http-multiple-get’ to (guix http-client).
>>
>>   2. Postpone the (guix substitute) bit to a separate patch series to
>>      leave us the time to polish things a bit and removes the
>>      single-process assumptions, or just move fewer things to (guix
>>      substitutes).
>>
>> You could push (guix narinfo) in the meantime since I think that one is
>> almost ready.
>>
>> How does that sound?  Am I being too cautious?
>
> Well, separating out the connection caching might be helpful for
> cleaning things up in the Guix Build Coordinator, I had to add a mutex
> currently as I'm guessing the caching isn't thread safe.

Precisely, that’s the kind of reason why it’s currently buried in (guix
scripts substitute) rather than exposed as a reusable library.  :-)

> I think it's possible to separate it out if some of the error handling
> is pushed down in to the http procedures, and if when they get an error
> indicating the connection is unusable, they close the port.

Ideally the (web …) modules would do that (that’s what you mean, right?)
but then we’d have to wait for Guile proper to implement these things.

> I've pushed some rough commits for this to this branch:
>
>   https://git.cbaines.net/guix/log/?h=prepare-to-move-guix-scripts-substitute-code
>
> I'm still struggling with the tests, currently make check hangs, I think
> on the challenge tests, and I don't currently have a plan to work out
> why the test is hanging.

Overall the approach LGTM.

How about first getting (guix narinfo) in ‘master’ (the bits we agreed
on), and then tackling the rest so that it’s less daunting?

Also, I’d like to get the zstd patches in.  :-)

Thanks,
Ludo’.