GNU bug report logs -
#36079
Source location information missing from identifiers
Previous Next
To reply to this bug, email your comments to 36079 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guile <at> gnu.org
:
bug#36079
; Package
guile
.
(Mon, 03 Jun 2019 20:43:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Robert Vollmert <rob <at> vllmrt.net>
:
New bug report received and forwarded. Copy sent to
bug-guile <at> gnu.org
.
(Mon, 03 Jun 2019 20:43:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Working on Guix, I encountered the following:
Within a guix checkout, I edited gnu/packages/haskell.scm, accidentally
making a Haskell comment:
(arguments
`(#:tests? #f)) -- sporadic failure: https://github.com/fpco/streaming-commons/issues/49
Then I tried to keep working on my in-development package, and was able to trace
the `guix build` error back to the following:
$ ./pre-inst-env guild compile ../modules/postgrest.scm
;;; note: source file /home/rob/guix/gnu/packages/haskell.scm
;;; newer than compiled /home/rob/guix/gnu/packages/haskell.go
;;; note: source file /home/rob/guix/gnu/packages/haskell.scm
;;; newer than compiled /run/current-system/profile/lib/guile/2.2/site-ccache/gnu/packages/haskell.go
ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
Syntax error:
unknown location: package: invalid field specifier in form —-
There are number of ways the error output could be improved. Ideally, I’d
like to see the offending line of gnu/packages/haskell.scm pin-pointed,
and/or the start of the enclosing package definition. But if that’s maybe
difficult due to macro expansion issues, at least knowing which file failed
to compile would be great. gnu/packages/haskell.scm does fail to compile
by itself:
$ guild compile gnu/packages/haskell.scm
ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
Syntax error:
unknown location: package: invalid field specifier in form —-
This is on a pretty up to date Guix install.
$ guild --version
guild (GNU Guile) 2.2.4
Information forwarded
to
bug-guile <at> gnu.org
:
bug#36079
; Package
guile
.
(Sun, 09 Jun 2019 20:10:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 36079 <at> debbugs.gnu.org (full text, mbox):
Hi Robert,
> Working on Guix, I encountered the following:
>
> Within a guix checkout, I edited gnu/packages/haskell.scm, accidentally
> making a Haskell comment:
>
> (arguments
> `(#:tests? #f)) -- sporadic failure: https://github.com/fpco/streaming-commons/issues/49
>
> Then I tried to keep working on my in-development package, and was able to trace
> the `guix build` error back to the following:
>
> $ ./pre-inst-env guild compile ../modules/postgrest.scm
> ;;; note: source file /home/rob/guix/gnu/packages/haskell.scm
> ;;; newer than compiled /home/rob/guix/gnu/packages/haskell.go
> ;;; note: source file /home/rob/guix/gnu/packages/haskell.scm
> ;;; newer than compiled /run/current-system/profile/lib/guile/2.2/site-ccache/gnu/packages/haskell.go
> ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
> Syntax error:
> unknown location: package: invalid field specifier in form —-
This error is produced by the “package” macro, which is of this form:
(package
(field value)
(another-field its-value)
…)
The macro has a number of valid field names and it tries to do some
simple validation. That’s where the error comes from. When “--” is
encountered it is in the position of a field, so the macro tries to be
helpful and reports that “--” is not a valid way to specify a field.
This error message is not produced by Guile.
> There are number of ways the error output could be improved. Ideally, I’d
> like to see the offending line of gnu/packages/haskell.scm pin-pointed,
> and/or the start of the enclosing package definition.
I agree that this would be nice. Let’s move this to the Guix bug
tracker.
--
Ricardo
Information forwarded
to
bug-guile <at> gnu.org
:
bug#36079
; Package
guile
.
(Tue, 11 Jun 2019 00:33:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 36079 <at> debbugs.gnu.org (full text, mbox):
Hi Ricardo and Robert,
Ricardo Wurmus <rekado <at> elephly.net> writes:
>> Working on Guix, I encountered the following:
>>
>> Within a guix checkout, I edited gnu/packages/haskell.scm, accidentally
>> making a Haskell comment:
>>
>> (arguments
>> `(#:tests? #f)) -- sporadic failure: https://github.com/fpco/streaming-commons/issues/49
>>
>> Then I tried to keep working on my in-development package, and was able to trace
>> the `guix build` error back to the following:
>>
>> $ ./pre-inst-env guild compile ../modules/postgrest.scm
>> ;;; note: source file /home/rob/guix/gnu/packages/haskell.scm
>> ;;; newer than compiled /home/rob/guix/gnu/packages/haskell.go
>> ;;; note: source file /home/rob/guix/gnu/packages/haskell.scm
>> ;;; newer than compiled /run/current-system/profile/lib/guile/2.2/site-ccache/gnu/packages/haskell.go
>> ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
>> Syntax error:
>> unknown location: package: invalid field specifier in form —-
>
> This error is produced by the “package” macro, which is of this form:
>
> (package
> (field value)
> (another-field its-value)
> …)
>
> The macro has a number of valid field names and it tries to do some
> simple validation. That’s where the error comes from. When “--” is
> encountered it is in the position of a field, so the macro tries to be
> helpful and reports that “--” is not a valid way to specify a field.
>
> This error message is not produced by Guile.
Well, yes and no. It is true that code in Guix is calling
'syntax-violation' to report the error. However, it is also true that
Guix passes to 'syntax-violation' the syntax object corresponding to
“--”, which ideally should have source location information attached to
it. If the syntax object in question represented a list or some other
heap-allocated value, it *would* have had source location information
attached, and that would have been included in the error message.
This issue is a longstanding limitation in Guile's source location
tracking. The problem is that Guile uses Scheme's standard 'read'
procedure to read the source code, which uses plain Scheme symbols to
represent identifiers. Scheme symbols with the same name are
indistinguishable, i.e. every occurrence of 'x' or '--' is represented
by precisely the same heap object, and therefore there's no way to
attach source information to each occurrence of a symbol.
Fixing this would involve abandoning Scheme's standard 'read' procedure
for reading source code, and instead using a different reader (not yet
written) that uses a different object type to represent identifiers and
immediate values. Our macro expander would need to be modified to
support this new representation.
I believe this should be done, and I hope to find the energy to do it
some day.
Mark
Changed bug title to 'Source location information missing from identifiers' from 'unhelpful error message'
Request was from
Ludovic Courtès <ludo <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 30 Jun 2019 15:24:01 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 348 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.