GNU bug report logs - #51463
Lack of error message in several guix subcommands

Previous Next

Package: guix;

Reported by: Alice BRENON <alice.brenon <at> ens-lyon.fr>

Date: Thu, 28 Oct 2021 17:16:02 UTC

Severity: important

Done: Ludovic Courtès <ludo <at> gnu.org>

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 51463 in the body.
You can then email your comments to 51463 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#51463; Package guix. (Thu, 28 Oct 2021 17:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alice BRENON <alice.brenon <at> ens-lyon.fr>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 28 Oct 2021 17:16:02 GMT) Full text and rfc822 format available.

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

From: Alice BRENON <alice.brenon <at> ens-lyon.fr>
To: bug-guix <at> gnu.org
Subject: Lack of error message in several guix subcommands
Date: Thu, 28 Oct 2021 19:15:17 +0200
[Message part 1 (text/plain, inline)]
Hi list,

I was giving guix shell a try today and noticed this annoying lack of
relevant feedback from the tool: when running on a particularly
malformed guix.scm, either by auto-loading or by explicitely passing -f
guix.scm, guix shell returned in error ($? == 1) without printing any
error message, which is a bit unhelpful.

The particular malformed guix.scm simply contains an extra parenthesis
after the package definition. Compare to the case when the package
definition lacks the final parenthesis, which yields a helpful message
like this:

/tmp/bug/guix.scm:25:1: missing closing parenthesis

This is not specific to guix shell because I could then reproduce this
behaviour with other commands like guix environment or guix build.

Find attached the file I've been using to reproduce the bug, which is
essentially the "hello" package example from the manual[1] without the
(define-public …) layer, in order for the top-level expression
contained in the file to be directly a package usable by -f (-l for
guix environment) and not have to put hello on the last line. The
version attached is correct and will allow guix shell -f guix.scm to
enter an environment where hello is installed. Remove a parenthesis,
you should have the above message. Add one, on the contrary, and you
should get nothing but silence.

I'm using guix on Guix System, and pulled this morning:

guix 5cbf9a4
  URL du dépôt : https://git.savannah.gnu.org/git/guix.git
  branche : master
  commit : 5cbf9a48d766191d8f17b2e9d1cf7b7db69b99ea


Regards,

Alice


[1]
https://guix.gnu.org/manual/devel/en/html_node/Defining-Packages.html
[guix.scm (text/x-scheme, attachment)]

Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 28 Oct 2021 22:46:02 GMT) Full text and rfc822 format available.

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 07 Nov 2021 22:15:02 GMT) Full text and rfc822 format available.

Notification sent to Alice BRENON <alice.brenon <at> ens-lyon.fr>:
bug acknowledged by developer. (Sun, 07 Nov 2021 22:15:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Alice BRENON <alice.brenon <at> ens-lyon.fr>
Cc: 51463-done <at> debbugs.gnu.org
Subject: Re: bug#51463: Lack of error message in several guix subcommands
Date: Sun, 07 Nov 2021 23:14:36 +0100
Hi Alice,

Alice BRENON <alice.brenon <at> ens-lyon.fr> skribis:

> I was giving guix shell a try today and noticed this annoying lack of
> relevant feedback from the tool: when running on a particularly
> malformed guix.scm, either by auto-loading or by explicitely passing -f
> guix.scm, guix shell returned in error ($? == 1) without printing any
> error message, which is a bit unhelpful.

I believe commit 4d59596a1c5f6b20870e619cbf67068ac7dd64ff fixes it (the
issue affected ‘read-error’ exceptions for reasons other than missing
closing parentheses).

Let me know if anything’s amiss.

Thanks!

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#51463; Package guix. (Mon, 08 Nov 2021 10:55:02 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>, Alice BRENON
 <alice.brenon <at> ens-lyon.fr>
Cc: 51463-done <at> debbugs.gnu.org
Subject: Re: bug#51463: Lack of error message in several guix subcommands
Date: Mon, 08 Nov 2021 11:45:18 +0100
Hi Ludo,

On Sun, 07 Nov 2021 at 23:14, Ludovic Courtès <ludo <at> gnu.org> wrote:

> I believe commit 4d59596a1c5f6b20870e619cbf67068ac7dd64ff fixes it (the
> issue affected ‘read-error’ exceptions for reasons other than missing
> closing parentheses).

With your fix, I am questioning the ’if’ test.  Introduced before
524c9800afb433cc474132185d8e37f72004adb3.


For instance, it reads,

--8<---------------cut here---------------start------------->8---
/tmp/pkgs/foo.scm:26:1: missing closing parenthesis
--8<---------------cut here---------------end--------------->8---

when Guile reports,

--8<---------------cut here---------------start------------->8---
/tmp/foo.scm:25:1: unexpected end of input while searching for: )
--8<---------------cut here---------------end--------------->8---

and this message is parsed to catch and report the first message,
instead.

Well, I agree that on one hand, Guile error messages seem badly worded
for newcomers.  On the other hand, post
4d59596a1c5f6b20870e619cbf67068ac7dd64ff, the message for extra
parenthesis,

--8<---------------cut here---------------start------------->8---
guix repl: error: read error while loading '/tmp/pkgs/foo.scm': /tmp/pkgs/foo.scm:25:23: unexpected ")"
--8<---------------cut here---------------end--------------->8---

is inconsistent from the one for missing parenthesis. Other said, the
then-branch uses ’format’ and the else-branch uses ’report-error’.


Some Guile errors are sometimes cryptic (the reason of “missing closing
parenthesis” I guess), therefore, the question is: do we add ’cond’
branches for each cases? Using “report-error” for all? Or do we only
rely on Guile error messages?  Dropping ’if’ test.


Last, checking and playing with all that, I note that this catch is done
when using ’load*’ and nothing is done for option ’load-path’.


Cheers,
simon




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 06 Dec 2021 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 141 days ago.

Previous Next


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