GNU bug report logs - #70551
channel-with-substitutes-available without network

Previous Next

Package: guix;

Reported by: Simon Tournier <zimon.toutoune <at> gmail.com>

Date: Wed, 24 Apr 2024 15:26:13 UTC

Severity: normal

Tags: patch

Done: Simon Tournier <zimon.toutoune <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 70551 in the body.
You can then email your comments to 70551 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#70551; Package guix. (Wed, 24 Apr 2024 15:26:16 GMT) Full text and rfc822 format available.

Acknowledgement sent to Simon Tournier <zimon.toutoune <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 24 Apr 2024 15:26:17 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: channel-with-substitutes-available without network
Date: Wed, 24 Apr 2024 16:43:14 +0200
[Message part 1 (text/plain, inline)]
Hi,

Out of any network, I get this error:

--8<---------------cut here---------------start------------->8---
$ guix time-machine --commit=1971d11d -- describe
guix time-machine: error: failed to load '/home/simon/.config//guix/channels.scm':
guix/build/download.scm:399:8: In procedure open-socket-for-uri:
In procedure getaddrinfo: Name or service not known
--8<---------------cut here---------------end--------------->8---

And that’s annoying.  It comes from:

        $ cat /home/simon/.config//guix/channels.scm
        (use-modules (guix ci))

        (list (channel-with-substitutes-available
               %default-guix-channel
               "https://ci.guix.gnu.org"))

as documented by section “Channels with Substitutes” [1].

Specifically, the error is raised by the procedure ’load*’ called by
’channel-list’ inside ’load-channels’.  Other said, ’load*’ runs the
procedure ’channel-with-substitutes-available’ which asks network via
the procedure ’find-latest-commit-with-substitutes’.

I think this is incorrect; the correct behaviour seems trying to do as
most as possible.  With the attached patch, I get:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix time-machine --commit=1971d11d -- describe
guix time-machine: warning: could not find available substitutes at https://ci.guix.gnu.org
  guix 1971d11
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 1971d11db9ed9683d5036cd4c62deb564842e1f6
--8<---------------cut here---------------end--------------->8---

Obviously, the option ’-q’ allows to bypass the problem. :-)  However,
it’s annoying because the default file channels.scm can be complex and
it still should work without any tweak, IMHO.

Well, the proposed fix is here to catch the error; maybe it could be
finer than #t.

WDYT?

Cheers,
simon


1: https://guix.gnu.org/manual/devel/en/guix.html#Channels-with-Substitutes

[0001-ci-Catch-error-for-channel-with-substitutes.patch (text/x-diff, inline)]
From 5955a4c3f913d1aa77ec3a27d6430f3dcf22aab6 Mon Sep 17 00:00:00 2001
Message-ID: <5955a4c3f913d1aa77ec3a27d6430f3dcf22aab6.1713969693.git.zimon.toutoune <at> gmail.com>
From: Simon Tournier <zimon.toutoune <at> gmail.com>
Date: Wed, 24 Apr 2024 16:39:10 +0200
Subject: [PATCH] ci: Catch error for channel with substitutes.

* guix/ci.scm (channel-with-substitutes-available): Catch all error when
running 'find-latest-commit-with-substitutes'.  Move the warning when failing.

Change-Id: I352e07f14417f77c7ebf0f40a01c6a2e58b15d78
---
 guix/ci.scm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/guix/ci.scm b/guix/ci.scm
index 5d16ee69d0..b2077448b0 100644
--- a/guix/ci.scm
+++ b/guix/ci.scm
@@ -336,10 +336,13 @@ (define (channel-with-substitutes-available chan url)
 
 If no commit with available substitutes were found, the commit field is set to
 false and a warning message is printed."
-  (let ((commit (find-latest-commit-with-substitutes url)))
-    (unless commit
-      (warning (G_ "could not find available substitutes at ~a~%")
-               url))
+  (let ((commit (catch #t
+                  (lambda ()
+                    (find-latest-commit-with-substitutes url))
+                  (lambda _
+                    (warning (G_ "could not find available substitutes at ~a~%")
+                             url)
+                    #false))))
     (channel
      (inherit chan)
      (commit commit))))

base-commit: 10d0e2d3110e4be2bc6cfecb9a3abb83d8e1ddd6
-- 
2.41.0


Information forwarded to bug-guix <at> gnu.org:
bug#70551; Package guix. (Wed, 05 Jun 2024 16:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 70551 <at> debbugs.gnu.org (full text, mbox):

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: 70551 <at> debbugs.gnu.org
Cc: Josselin Poiret <dev <at> jpoiret.xyz>,
 Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, Ricardo Wurmus <rekado <at> elephly.net>,
 Christopher Baines <guix <at> cbaines.net>
Subject: Re: bug#70551: channel-with-substitutes-available without network
Date: Wed, 05 Jun 2024 10:14:14 +0200
Hi,

CC: core team

On Wed, 24 Apr 2024 at 16:43, Simon Tournier <zimon.toutoune <at> gmail.com> wrote:

> Out of any network, I get this error:
>
> --8<---------------cut here---------------start------------->8---
> $ guix time-machine --commit=1971d11d -- describe
> guix time-machine: error: failed to load '/home/simon/.config//guix/channels.scm':
> guix/build/download.scm:399:8: In procedure open-socket-for-uri:
> In procedure getaddrinfo: Name or service not known
> --8<---------------cut here---------------end--------------->8---
>
> And that’s annoying.  It comes from:
>
>         $ cat /home/simon/.config//guix/channels.scm
>         (use-modules (guix ci))
>
>         (list (channel-with-substitutes-available
>                %default-guix-channel
>                "https://ci.guix.gnu.org"))
>
> as documented by section “Channels with Substitutes” [1].
>
> Specifically, the error is raised by the procedure ’load*’ called by
> ’channel-list’ inside ’load-channels’.  Other said, ’load*’ runs the
> procedure ’channel-with-substitutes-available’ which asks network via
> the procedure ’find-latest-commit-with-substitutes’.
>
> I think this is incorrect; the correct behaviour seems trying to do as
> most as possible.  With the attached patch, I get:
>
> --8<---------------cut here---------------start------------->8---
> $ ./pre-inst-env guix time-machine --commit=1971d11d -- describe
> guix time-machine: warning: could not find available substitutes at https://ci.guix.gnu.org
>   guix 1971d11
>     repository URL: https://git.savannah.gnu.org/git/guix.git
>     branch: master
>     commit: 1971d11db9ed9683d5036cd4c62deb564842e1f6
> --8<---------------cut here---------------end--------------->8---
>
> Obviously, the option ’-q’ allows to bypass the problem. :-)  However,
> it’s annoying because the default file channels.scm can be complex and
> it still should work without any tweak, IMHO.
>
> Well, the proposed fix is here to catch the error; maybe it could be
> finer than #t.
>
> WDYT?
>
> Cheers,
> simon
>
>
> 1: https://guix.gnu.org/manual/devel/en/guix.html#Channels-with-Substitutes
>
> From 5955a4c3f913d1aa77ec3a27d6430f3dcf22aab6 Mon Sep 17 00:00:00 2001
> Message-ID: <5955a4c3f913d1aa77ec3a27d6430f3dcf22aab6.1713969693.git.zimon.toutoune <at> gmail.com>
> From: Simon Tournier <zimon.toutoune <at> gmail.com>
> Date: Wed, 24 Apr 2024 16:39:10 +0200
> Subject: [PATCH] ci: Catch error for channel with substitutes.
>
> * guix/ci.scm (channel-with-substitutes-available): Catch all error when
> running 'find-latest-commit-with-substitutes'.  Move the warning when failing.
>
> Change-Id: I352e07f14417f77c7ebf0f40a01c6a2e58b15d78
> ---
>  guix/ci.scm | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/guix/ci.scm b/guix/ci.scm
> index 5d16ee69d0..b2077448b0 100644
> --- a/guix/ci.scm
> +++ b/guix/ci.scm
> @@ -336,10 +336,13 @@ (define (channel-with-substitutes-available chan url)
>  
>  If no commit with available substitutes were found, the commit field is set to
>  false and a warning message is printed."
> -  (let ((commit (find-latest-commit-with-substitutes url)))
> -    (unless commit
> -      (warning (G_ "could not find available substitutes at ~a~%")
> -               url))
> +  (let ((commit (catch #t
> +                  (lambda ()
> +                    (find-latest-commit-with-substitutes url))
> +                  (lambda _
> +                    (warning (G_ "could not find available substitutes at ~a~%")
> +                             url)
> +                    #false))))
>      (channel
>       (inherit chan)
>       (commit commit))))
>
> base-commit: 10d0e2d3110e4be2bc6cfecb9a3abb83d8e1ddd6
> -- 
> 2.41.0

Friendly ping for this patch?


Cheers,
simon




Added tag(s) patch. Request was from Simon Tournier <zimon.toutoune <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 05 Jun 2024 16:35:03 GMT) Full text and rfc822 format available.

Reply sent to Simon Tournier <zimon.toutoune <at> gmail.com>:
You have taken responsibility. (Tue, 23 Jul 2024 14:38:03 GMT) Full text and rfc822 format available.

Notification sent to Simon Tournier <zimon.toutoune <at> gmail.com>:
bug acknowledged by developer. (Tue, 23 Jul 2024 14:38:04 GMT) Full text and rfc822 format available.

Message #15 received at 70551-done <at> debbugs.gnu.org (full text, mbox):

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: 70551-done <at> debbugs.gnu.org
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, Ricardo Wurmus <rekado <at> elephly.net>,
 Christopher Baines <guix <at> cbaines.net>
Subject: Re: bug#70551: channel-with-substitutes-available without network
Date: Tue, 23 Jul 2024 16:35:36 +0200
Hi,

On Wed, 05 Jun 2024 at 10:14, Simon Tournier <zimon.toutoune <at> gmail.com> wrote:
> On Wed, 24 Apr 2024 at 16:43, Simon Tournier <zimon.toutoune <at> gmail.com> wrote:
>
>> Out of any network, I get this error:

[...]

>> Well, the proposed fix is here to catch the error; maybe it could be
>> finer than #t.

[...]

> Friendly ping for this patch?

Pushed as ffdcef5f36196f5e004ca6cb96f5accc0c73fc92.

Cheers,
simon




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 21 Aug 2024 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 326 days ago.

Previous Next


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