Discussion:
Cryptic error messages: Bug in guile?
swedebugia
2018-11-13 01:35:54 UTC
Permalink
Hi

I try to package for guix.
Sometimes I forget a parens somewhere.

When I invoke make in the guix source tree the parens error will be
reported as any other kind of error. (unbound variable, package not
found, etc)

I would like to know if there is a way to avoid/improve this.

E.g. make guile count parens before evaluation or whatever so that I get
a clear error, fast.

Alternatively maybe somebody else has a parens counter script I could
use? E.g. I could tell make to first traverse all files looking for
unmatching parens.
--
Cheers Swedebugia
b***@posteo.net
2018-11-13 01:44:17 UTC
Permalink
Post by swedebugia
Hi
I try to package for guix.
Sometimes I forget a parens somewhere.
When I invoke make in the guix source tree the parens error will be
reported as any other kind of error. (unbound variable, package not
found, etc)
I would like to know if there is a way to avoid/improve this.
E.g. make guile count parens before evaluation or whatever so that I
get a clear error, fast.
Alternatively maybe somebody else has a parens counter script I could
use? E.g. I could tell make to first traverse all files looking for
unmatching parens.
Generally you can backtrace these kinds of errors and see what the
unbound variable is tied to some Guile module that you can declare. IIRC
this is also available in `guix lint`.

Did that help any?

Brett Gilio
Alex Vong
2018-11-13 01:48:11 UTC
Permalink
Hello,
Post by swedebugia
Hi
I try to package for guix.
Sometimes I forget a parens somewhere.
When I invoke make in the guix source tree the parens error will be
reported as any other kind of error. (unbound variable, package not
found, etc)
I would like to know if there is a way to avoid/improve this.
E.g. make guile count parens before evaluation or whatever so that I
get a clear error, fast.
Alternatively maybe somebody else has a parens counter script I could
use? E.g. I could tell make to first traverse all files looking for
unmatching parens.
What error message do you receive? Usually I get something like:

ERROR: In procedure read:
In procedure scm_i_lreadparen: #<unknown port>:1:2: end of file
Ludovic Courtès
2018-11-20 20:47:32 UTC
Permalink
Hi,
Post by Alex Vong
Post by swedebugia
Hi
I try to package for guix.
Sometimes I forget a parens somewhere.
When I invoke make in the guix source tree the parens error will be
reported as any other kind of error. (unbound variable, package not
found, etc)
[...]
Post by Alex Vong
In procedure scm_i_lreadparen: #<unknown port>:1:2: end of file
This message is rather obscure (unless you’re familiar with
libguile/read.c) so Guix has a hack to translate it into a
human-readable message:

https://git.savannah.gnu.org/cgit/guix.git/tree/guix/ui.scm#n348

Ludo’.

Loading...