all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#70551: channel-with-substitutes-available without network
@ 2024-04-24 14:43 Simon Tournier
  2024-06-05  8:14 ` Simon Tournier
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Tournier @ 2024-04-24 14:43 UTC (permalink / raw)
  To: 70551

[-- Attachment #1: Type: text/plain, Size: 2029 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: p.patch --]
[-- Type: text/x-diff, Size: 1514 bytes --]

From 5955a4c3f913d1aa77ec3a27d6430f3dcf22aab6 Mon Sep 17 00:00:00 2001
Message-ID: <5955a4c3f913d1aa77ec3a27d6430f3dcf22aab6.1713969693.git.zimon.toutoune@gmail.com>
From: Simon Tournier <zimon.toutoune@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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#70551: channel-with-substitutes-available without network
  2024-04-24 14:43 bug#70551: channel-with-substitutes-available without network Simon Tournier
@ 2024-06-05  8:14 ` Simon Tournier
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Tournier @ 2024-06-05  8:14 UTC (permalink / raw)
  To: 70551
  Cc: Josselin Poiret, Simon Tournier, Mathieu Othacehe,
	Ludovic Courtès, Tobias Geerinckx-Rice, Ricardo Wurmus,
	Christopher Baines

Hi,

CC: core team

On Wed, 24 Apr 2024 at 16:43, Simon Tournier <zimon.toutoune@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@gmail.com>
> From: Simon Tournier <zimon.toutoune@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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-05 16:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-24 14:43 bug#70551: channel-with-substitutes-available without network Simon Tournier
2024-06-05  8:14 ` Simon Tournier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.