unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#42802: Unhandled FTP exception when using GNU importer
@ 2020-08-10 18:33 Maxim Cournoyer
  2021-02-02 12:58 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Maxim Cournoyer @ 2020-08-10 18:33 UTC (permalink / raw)
  To: 42802

Here I naively tried importing libsocketcan, which isn't a GNU project:

--8<---------------cut here---------------start------------->8---
guix import gnu libsocketcan
Backtrace:
          10 (primitive-load "/home/maxim/.config/guix/current/bin/guix")
In guix/ui.scm:
  2046:12  9 (run-guix-command _ . _)
In guix/scripts/import.scm:
   116:11  8 (guix-import . _)
In ice-9/boot-9.scm:
  1736:10  7 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
  1731:15  6 (with-exception-handler #<procedure 7f19d6ef7270 at ice-9/boot-9.scm:1815:7 (exn)> _ #:unwind? _ #:unwind-for-type _)
In guix/import/gnu.scm:
    111:2  5 (gnu->guix-package "libsocketcan" #:key-download _)
In guix/gnu-maintenance.scm:
   364:20  4 (latest-ftp-release "libsocketcan" #:server _ #:directory _ #:keep-file? _ #:file->signature _ #:ftp-open _ #:ftp-close _)
In guix/ftp-client.scm:
    233:6  3 (ftp-list #<<ftp-connection> socket: #<input-output: socket 16> addrinfo: #(32 2 1 6 #(2 3509828628 21) #f)> _ #:timeout _)
In srfi/srfi-1.scm:
   460:18  2 (fold #<procedure 7f19d6ef71b0 at guix/ftp-client.scm:187:10 (dir result)> _ _)
In guix/ftp-client.scm:
     74:8  1 (_ _ _)
In ice-9/boot-9.scm:
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Throw to key `ftp-error' with args `(#<input-output: socket 16> "CWD
libsocketcan" 550 "Failed to change directory.\r")'.

--8<---------------cut here---------------end--------------->8---

The error should be handled and a more appropriate message should be
displayed to the user.

Maxim




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

* bug#42802: Unhandled FTP exception when using GNU importer
  2020-08-10 18:33 bug#42802: Unhandled FTP exception when using GNU importer Maxim Cournoyer
@ 2021-02-02 12:58 ` Ludovic Courtès
  2021-02-02 14:09   ` zimoun
  2021-02-02 14:12   ` Maxim Cournoyer
  0 siblings, 2 replies; 6+ messages in thread
From: Ludovic Courtès @ 2021-02-02 12:58 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 42802-done

Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> Here I naively tried importing libsocketcan, which isn't a GNU project:
>
> guix import gnu libsocketcan
> Backtrace:
>           10 (primitive-load "/home/maxim/.config/guix/current/bin/guix")
> In guix/ui.scm:
>   2046:12  9 (run-guix-command _ . _)
> In guix/scripts/import.scm:
>    116:11  8 (guix-import . _)
> In ice-9/boot-9.scm:
>   1736:10  7 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
>   1731:15  6 (with-exception-handler #<procedure 7f19d6ef7270 at ice-9/boot-9.scm:1815:7 (exn)> _ #:unwind? _ #:unwind-for-type _)
> In guix/import/gnu.scm:
>     111:2  5 (gnu->guix-package "libsocketcan" #:key-download _)
> In guix/gnu-maintenance.scm:
>    364:20  4 (latest-ftp-release "libsocketcan" #:server _ #:directory _ #:keep-file? _ #:file->signature _ #:ftp-open _ #:ftp-close _)
> In guix/ftp-client.scm:
>     233:6  3 (ftp-list #<<ftp-connection> socket: #<input-output: socket 16> addrinfo: #(32 2 1 6 #(2 3509828628 21) #f)> _ #:timeout _)
> In srfi/srfi-1.scm:
>    460:18  2 (fold #<procedure 7f19d6ef71b0 at guix/ftp-client.scm:187:10 (dir result)> _ _)
> In guix/ftp-client.scm:
>      74:8  1 (_ _ _)
> In ice-9/boot-9.scm:
>   1669:16  0 (raise-exception _ #:continuable? _)
>
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> Throw to key `ftp-error' with args `(#<input-output: socket 16> "CWD
> libsocketcan" 550 "Failed to change directory.\r")'.
>
> The error should be handled and a more appropriate message should be
> displayed to the user.

I believe this is fixed by be84fc600e76e3962123b94bf14baea4a2e4f442.

Ludo’.




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

* bug#42802: Unhandled FTP exception when using GNU importer
  2021-02-02 12:58 ` Ludovic Courtès
@ 2021-02-02 14:09   ` zimoun
  2021-02-02 14:12   ` Maxim Cournoyer
  1 sibling, 0 replies; 6+ messages in thread
From: zimoun @ 2021-02-02 14:09 UTC (permalink / raw)
  To: 42802, Ludovic Courtès, Maxim Cournoyer; +Cc: 42802-done

Hi,

On Tue, 2 Feb 2021 at 13:59, Ludovic Courtès <ludo@gnu.org> wrote:

> > The error should be handled and a more appropriate message should be
> > displayed to the user.
>
> I believe this is fixed by be84fc600e76e3962123b94bf14baea4a2e4f442.

Ah sorry, I missed this bug and so report it in the commit message.

Cheers,
simon




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

* bug#42802: Unhandled FTP exception when using GNU importer
  2021-02-02 12:58 ` Ludovic Courtès
  2021-02-02 14:09   ` zimoun
@ 2021-02-02 14:12   ` Maxim Cournoyer
  2021-02-02 14:31     ` zimoun
  1 sibling, 1 reply; 6+ messages in thread
From: Maxim Cournoyer @ 2021-02-02 14:12 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 42802-done

Hi Ludo,

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

> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> Here I naively tried importing libsocketcan, which isn't a GNU project:
>>
>> guix import gnu libsocketcan
>> Backtrace:
>>           10 (primitive-load "/home/maxim/.config/guix/current/bin/guix")
>> In guix/ui.scm:
>>   2046:12  9 (run-guix-command _ . _)
>> In guix/scripts/import.scm:
>>    116:11  8 (guix-import . _)
>> In ice-9/boot-9.scm:
>>   1736:10  7 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
>>   1731:15  6 (with-exception-handler #<procedure 7f19d6ef7270 at ice-9/boot-9.scm:1815:7 (exn)> _ #:unwind? _ #:unwind-for-type _)
>> In guix/import/gnu.scm:
>>     111:2  5 (gnu->guix-package "libsocketcan" #:key-download _)
>> In guix/gnu-maintenance.scm:
>>    364:20  4 (latest-ftp-release "libsocketcan" #:server _ #:directory _ #:keep-file? _ #:file->signature _ #:ftp-open _ #:ftp-close _)
>> In guix/ftp-client.scm:
>>     233:6  3 (ftp-list #<<ftp-connection> socket: #<input-output: socket 16> addrinfo: #(32 2 1 6 #(2 3509828628 21) #f)> _ #:timeout _)
>> In srfi/srfi-1.scm:
>>    460:18  2 (fold #<procedure 7f19d6ef71b0 at guix/ftp-client.scm:187:10 (dir result)> _ _)
>> In guix/ftp-client.scm:
>>      74:8  1 (_ _ _)
>> In ice-9/boot-9.scm:
>>   1669:16  0 (raise-exception _ #:continuable? _)
>>
>> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
>> Throw to key `ftp-error' with args `(#<input-output: socket 16> "CWD
>> libsocketcan" 550 "Failed to change directory.\r")'.
>>
>> The error should be handled and a more appropriate message should be
>> displayed to the user.
>
> I believe this is fixed by be84fc600e76e3962123b94bf14baea4a2e4f442.
>
> Ludo’.

./pre-inst-env guix import gnu libsocketcan
guix import: error: failed to determine latest release of GNU libsocketcan

Thanks for the fix; that's much nicer than a backtrace.  It would be
even better if it said:

'guix import: error: No GNU package found for "libsocketcan"'

Thanks!

Maxim




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

* bug#42802: Unhandled FTP exception when using GNU importer
  2021-02-02 14:12   ` Maxim Cournoyer
@ 2021-02-02 14:31     ` zimoun
  2021-02-02 18:50       ` Maxim Cournoyer
  0 siblings, 1 reply; 6+ messages in thread
From: zimoun @ 2021-02-02 14:31 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 42802-done

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

Hi Maxim

On Tue, 2 Feb 2021 at 15:13, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

> ./pre-inst-env guix import gnu libsocketcan
> guix import: error: failed to determine latest release of GNU libsocketcan
>
> Thanks for the fix; that's much nicer than a backtrace.  It would be
> even better if it said:
>
> 'guix import: error: No GNU package found for "libsocketcan"'

Yeah, replace the message sounds good.  The one you are proposing
works for both cases: "guix import gnu hello@1.2.3" and "guix import
gnu not-gnu-package".  Even if version is not supported, another
story.
Attached the trivial patch in case.


Cheers,
simon

[-- Attachment #2: 0001-import-gnu-Fix-error-message.patch --]
[-- Type: text/x-patch, Size: 806 bytes --]

From 16030b867b9f0e70f3811026ed451d2bba1299d2 Mon Sep 17 00:00:00 2001
From: zimoun <zimon.toutoune@gmail.com>
Date: Tue, 2 Feb 2021 15:30:22 +0100
Subject: [PATCH] import: gnu: Fix error message.

* guix/import/gnu.scm (gnu->guix-package): Fix error message.
---
 guix/import/gnu.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/import/gnu.scm b/guix/import/gnu.scm
index c26faff04b..2fa63cb184 100644
--- a/guix/import/gnu.scm
+++ b/guix/import/gnu.scm
@@ -123,7 +123,7 @@ details.)"
           (gnu-package->sexp info release #:key-download key-download)))))
     (_
      (raise (formatted-message
-             (G_ "failed to determine latest release of GNU ~a")
+             (G_ "no GNU package found for ~a")
              name)))))
 
 ;;; gnu.scm ends here
-- 
2.28.0


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

* bug#42802: Unhandled FTP exception when using GNU importer
  2021-02-02 14:31     ` zimoun
@ 2021-02-02 18:50       ` Maxim Cournoyer
  0 siblings, 0 replies; 6+ messages in thread
From: Maxim Cournoyer @ 2021-02-02 18:50 UTC (permalink / raw)
  To: zimoun; +Cc: 42802-done

Hi Simon,

zimoun <zimon.toutoune@gmail.com> writes:

> Hi Maxim
>
> On Tue, 2 Feb 2021 at 15:13, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
>
>> ./pre-inst-env guix import gnu libsocketcan
>> guix import: error: failed to determine latest release of GNU libsocketcan
>>
>> Thanks for the fix; that's much nicer than a backtrace.  It would be
>> even better if it said:
>>
>> 'guix import: error: No GNU package found for "libsocketcan"'


> Yeah, replace the message sounds good.  The one you are proposing
> works for both cases: "guix import gnu hello@1.2.3" and "guix import
> gnu not-gnu-package".  Even if version is not supported, another
> story.
> Attached the trivial patch in case.

There was more to it than just the message; some code was already in
place to address this case but was not exercised.

See commit 889f425b35, which fixes it.

Thanks!

Maxim




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

end of thread, other threads:[~2021-02-02 18:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-10 18:33 bug#42802: Unhandled FTP exception when using GNU importer Maxim Cournoyer
2021-02-02 12:58 ` Ludovic Courtès
2021-02-02 14:09   ` zimoun
2021-02-02 14:12   ` Maxim Cournoyer
2021-02-02 14:31     ` zimoun
2021-02-02 18:50       ` Maxim Cournoyer

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).