unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* improve error message for `guix environment'
@ 2015-03-16  8:33 Tomáš Čech
  2015-03-16 13:04 ` David Thompson
  0 siblings, 1 reply; 6+ messages in thread
From: Tomáš Čech @ 2015-03-16  8:33 UTC (permalink / raw)
  To: guix-devel

When network issue occurs during `guix environment <package>' call,
the error message is too cryptic:


$ guix environment gnash
;;; note: source file /Devel/git/guix/gnu/packages/dictionaries.scm
;;;       newer than compiled /Devel/git/guix/gnu/packages/dictionaries.go
;;; note: source file /Devel/git/guix/gnu/packages/graphics.scm
;;;       newer than compiled /Devel/git/guix/gnu/packages/graphics.go
substitute-binary: guix substitute-binary: warning: failed to look up host 'hydra.gnu.org' (Temporary failure in name resolution), substituter disabled
The following derivations will be built:
   /gnu/store/9z9bpm9pwhd3dwx5kfwwqbirfd3v6bn5-coreutils-8.23.tar.xz.drv
   /gnu/store/y1b1dvljiyz4s8r2bhp3ch9nijm8dnh6-coreutils-8.23.tar.xz.drv
   /gnu/store/0p2nh8j0ad1qsd2ipwhlp6zais1jbc3m-glib-2.42.1.tar.xz.drv
   /gnu/store/wmy3xalfpg9vw4awfflgl26mynxv7554-glib-2.42.1.tar.xz.drv
   /gnu/store/pph3srjx594rcq0cjah679rd5xc7nqi2-coreutils-8.23.drv
   /gnu/store/k4y35xga43ib54688i76n11phz1xhrnz-giflib-4.2.3.tar.bz2.drv
starting download of `/gnu/store/xc4r4ym38y83i4ncdavrcg8h8m4vm499-giflib-4.2.3.tar.bz2' from `http://prdownloads.sourceforge.net/giflib/giflib-4.x/giflib-4.2.3.tar.bz2'..
.
ERROR: In procedure getaddrinfo: Temporary failure in name resolution
starting download of `/gnu/store/xc4r4ym38y83i4ncdavrcg8h8m4vm499-giflib-4.2.3.tar.bz2' from `http://heanet.dl.sourceforge.net/sourceforge/giflib/giflib-4.x/giflib-4.2.3.
tar.bz2'...
ERROR: In procedure getaddrinfo: Temporary failure in name resolution
starting download of `/gnu/store/xc4r4ym38y83i4ncdavrcg8h8m4vm499-giflib-4.2.3.tar.bz2' from `http://surfnet.dl.sourceforge.net/sourceforge/giflib/giflib-4.x/giflib-4.2.3
.tar.bz2'...
ERROR: In procedure getaddrinfo: Temporary failure in name resolution
starting download of `/gnu/store/xc4r4ym38y83i4ncdavrcg8h8m4vm499-giflib-4.2.3.tar.bz2' from `http://dfn.dl.sourceforge.net/sourceforge/giflib/giflib-4.x/giflib-4.2.3.tar
.bz2'...
ERROR: In procedure getaddrinfo: Temporary failure in name resolution
starting download of `/gnu/store/xc4r4ym38y83i4ncdavrcg8h8m4vm499-giflib-4.2.3.tar.bz2' from `http://mesh.dl.sourceforge.net/sourceforge/giflib/giflib-4.x/giflib-4.2.3.ta
r.bz2'...
ERROR: In procedure getaddrinfo: Temporary failure in name resolution
starting download of `/gnu/store/xc4r4ym38y83i4ncdavrcg8h8m4vm499-giflib-4.2.3.tar.bz2' from `http://ovh.dl.sourceforge.net/sourceforge/giflib/giflib-4.x/giflib-4.2.3.tar
.bz2'...
ERROR: In procedure getaddrinfo: Temporary failure in name resolution
starting download of `/gnu/store/xc4r4ym38y83i4ncdavrcg8h8m4vm499-giflib-4.2.3.tar.bz2' from `http://osdn.dl.sourceforge.net/sourceforge/giflib/giflib-4.x/giflib-4.2.3.ta
r.bz2'...
ERROR: In procedure getaddrinfo: Temporary failure in name resolution
failed to download "/gnu/store/xc4r4ym38y83i4ncdavrcg8h8m4vm499-giflib-4.2.3.tar.bz2" from "mirror://sourceforge/giflib/giflib-4.x/giflib-4.2.3.tar.bz2"
builder for `/gnu/store/k4y35xga43ib54688i76n11phz1xhrnz-giflib-4.2.3.tar.bz2.drv' failed to produce output path `/gnu/store/xc4r4ym38y83i4ncdavrcg8h8m4vm499-giflib-4.2.3
.tar.bz2'
cannot build derivation `/gnu/store/z8f07h9gix3p33jqv6sckqd2ynn40mv5-giflib-4.2.3.drv': 1 dependencies couldn't be built
Backtrace:
In ice-9/boot-9.scm:
 157: 14 [catch #t #<catch-closure 12fd7e0> ...]
In unknown file:
   ?: 13 [apply-smob/1 #<catch-closure 12fd7e0>]
In ice-9/boot-9.scm:
  63: 12 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 11 [eval # #]
In ice-9/boot-9.scm:
2401: 10 [save-module-excursion #<procedure 131a940 at ice-9/boot-9.scm:4045:3 ()>]
4050: 9 [#<procedure 131a940 at ice-9/boot-9.scm:4045:3 ()>]
1724: 8 [%start-stack load-stack ...]
1729: 7 [#<procedure 1332ea0 ()>]
In unknown file:
   ?: 6 [primitive-load "/Devel/git/guix/scripts/guix"]
In guix/ui.scm:
 849: 5 [run-guix-command environment "gnash"]
In guix/scripts/environment.scm:
 224: 4 [guix-environment "gnash"]
In guix/store.scm:
 936: 3 [run-with-store # ...]
In guix/scripts/environment.scm:
 213: 2 [#<procedure 3d23e70 at guix/scripts/environment.scm:213:12 (state)> #]
In guix/store.scm:
 883: 1 [#<procedure 3d23c60 at guix/store.scm:882:28 (store)> #]
 580: 0 [build-things # #]

guix/store.scm:580:0: In procedure build-things:
guix/store.scm:580:0: Throw to key `srfi-34' with args `(#<condition &nix-protocol-error [message: "build of `/gnu/store/z8f07h9gix3p33jqv6sckqd2ynn40mv5-giflib-4.2.3.drv
' failed" status: 1] 3d64ba0>)'.

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

* Re: improve error message for `guix environment'
  2015-03-16  8:33 improve error message for `guix environment' Tomáš Čech
@ 2015-03-16 13:04 ` David Thompson
  2015-03-16 15:47   ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: David Thompson @ 2015-03-16 13:04 UTC (permalink / raw)
  To: Tomáš Čech, guix-devel

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

Tomáš Čech <sleep_walker@gnu.org> writes:

> When network issue occurs during `guix environment <package>' call,
> the error message is too cryptic:

If you can reproduce it, could you please apply this patch and tell me
if it makes things any better?  The 'with-error-handling' form will
catch a bunch of possible errors and print out friendlier messages.

Thanks!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-scripts-environment-Improve-error-messages.patch --]
[-- Type: text/x-diff, Size: 2498 bytes --]

From 13113846f0f19b57f271dc71b5cbc606d8c2b68a Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Mon, 16 Mar 2015 08:59:59 -0400
Subject: [PATCH] scripts: environment: Improve error messages.

* guix/scripts/environment.scm (guix-environmnet): Wrap procedure body with
  error handling form.
---
 guix/scripts/environment.scm | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index c96ca35..80ae924 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -220,21 +220,22 @@ packages."
   (define (handle-argument arg result)
     (alist-cons 'package arg result))
 
-  (with-store store
-    (let* ((opts  (parse-command-line args %options (list %default-options)
-                                      #:argument-handler handle-argument))
-           (pure? (assoc-ref opts 'pure))
-           (command (assoc-ref opts 'exec))
-           (inputs (packages->transitive-inputs
-                    (pick-all (options/resolve-packages opts) 'package)))
-           (drvs (run-with-store store
-                   (mbegin %store-monad
-                     (set-guile-for-build (default-guile))
-                     (build-inputs inputs opts)))))
-      (cond ((assoc-ref opts 'dry-run?)
-             #t)
-            ((assoc-ref opts 'search-paths)
-             (show-search-paths inputs drvs pure?))
-            (else
-             (create-environment inputs drvs pure?)
-             (system command))))))
+  (with-error-handling
+    (with-store store
+      (let* ((opts  (parse-command-line args %options (list %default-options)
+                                        #:argument-handler handle-argument))
+             (pure? (assoc-ref opts 'pure))
+             (command (assoc-ref opts 'exec))
+             (inputs (packages->transitive-inputs
+                      (pick-all (options/resolve-packages opts) 'package)))
+             (drvs (run-with-store store
+                     (mbegin %store-monad
+                       (set-guile-for-build (default-guile))
+                       (build-inputs inputs opts)))))
+        (cond ((assoc-ref opts 'dry-run?)
+               #t)
+              ((assoc-ref opts 'search-paths)
+               (show-search-paths inputs drvs pure?))
+              (else
+               (create-environment inputs drvs pure?)
+               (system command)))))))
-- 
2.1.4


[-- Attachment #3: Type: text/plain, Size: 136 bytes --]


-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate

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

* Re: improve error message for `guix environment'
  2015-03-16 13:04 ` David Thompson
@ 2015-03-16 15:47   ` Ludovic Courtès
  2015-03-16 16:12     ` Ricardo Wurmus
  2015-03-16 23:49     ` David Thompson
  0 siblings, 2 replies; 6+ messages in thread
From: Ludovic Courtès @ 2015-03-16 15:47 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

David Thompson <dthompson2@worcester.edu> skribis:

> From 13113846f0f19b57f271dc71b5cbc606d8c2b68a Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson2@worcester.edu>
> Date: Mon, 16 Mar 2015 08:59:59 -0400
> Subject: [PATCH] scripts: environment: Improve error messages.
>
> * guix/scripts/environment.scm (guix-environmnet): Wrap procedure body with
>   error handling form.

Oh yes, that’s the right thing to do, please push.

Thanks,
Ludo’.

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

* Re: improve error message for `guix environment'
  2015-03-16 15:47   ` Ludovic Courtès
@ 2015-03-16 16:12     ` Ricardo Wurmus
  2015-03-16 16:17       ` Thompson, David
  2015-03-16 23:49     ` David Thompson
  1 sibling, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2015-03-16 16:12 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


Ludovic Courtès writes:

> David Thompson <dthompson2@worcester.edu> skribis:
>
>> From 13113846f0f19b57f271dc71b5cbc606d8c2b68a Mon Sep 17 00:00:00 2001
>> From: David Thompson <dthompson2@worcester.edu>
>> Date: Mon, 16 Mar 2015 08:59:59 -0400
>> Subject: [PATCH] scripts: environment: Improve error messages.
>>
>> * guix/scripts/environment.scm (guix-environmnet): Wrap procedure body with
>>   error handling form.

There's a typo: "(guix-environmnet)" should be "(guix-environment)".

~~ Ricardo

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

* Re: improve error message for `guix environment'
  2015-03-16 16:12     ` Ricardo Wurmus
@ 2015-03-16 16:17       ` Thompson, David
  0 siblings, 0 replies; 6+ messages in thread
From: Thompson, David @ 2015-03-16 16:17 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

On Mon, Mar 16, 2015 at 12:12 PM, Ricardo Wurmus
<ricardo.wurmus@mdc-berlin.de> wrote:
>
> Ludovic Courtès writes:
>
>> David Thompson <dthompson2@worcester.edu> skribis:
>>
>>> From 13113846f0f19b57f271dc71b5cbc606d8c2b68a Mon Sep 17 00:00:00 2001
>>> From: David Thompson <dthompson2@worcester.edu>
>>> Date: Mon, 16 Mar 2015 08:59:59 -0400
>>> Subject: [PATCH] scripts: environment: Improve error messages.
>>>
>>> * guix/scripts/environment.scm (guix-environmnet): Wrap procedure body with
>>>   error handling form.
>
> There's a typo: "(guix-environmnet)" should be "(guix-environment)".

Good catch.  Thanks!

- Dave

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

* Re: improve error message for `guix environment'
  2015-03-16 15:47   ` Ludovic Courtès
  2015-03-16 16:12     ` Ricardo Wurmus
@ 2015-03-16 23:49     ` David Thompson
  1 sibling, 0 replies; 6+ messages in thread
From: David Thompson @ 2015-03-16 23:49 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Ludovic Courtès <ludo@gnu.org> writes:

> David Thompson <dthompson2@worcester.edu> skribis:
>
>> From 13113846f0f19b57f271dc71b5cbc606d8c2b68a Mon Sep 17 00:00:00 2001
>> From: David Thompson <dthompson2@worcester.edu>
>> Date: Mon, 16 Mar 2015 08:59:59 -0400
>> Subject: [PATCH] scripts: environment: Improve error messages.
>>
>> * guix/scripts/environment.scm (guix-environmnet): Wrap procedure body with
>>   error handling form.
>
> Oh yes, that’s the right thing to do, please push.

Pushed.

Perhaps it would be a good idea to just wrap '(apply command-main args)'
with 'with-error-handling' in (guix ui) so that every guix subcommand
has friendly error handling by default.  Thoughts?

-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate

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

end of thread, other threads:[~2015-03-16 23:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16  8:33 improve error message for `guix environment' Tomáš Čech
2015-03-16 13:04 ` David Thompson
2015-03-16 15:47   ` Ludovic Courtès
2015-03-16 16:12     ` Ricardo Wurmus
2015-03-16 16:17       ` Thompson, David
2015-03-16 23:49     ` David Thompson

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).