* [bug #30169] Auto-compilation failure of a module doesn't lead to a failure [1.9.11]
@ 2010-06-17 13:06 Ludovic Courtès
2010-06-18 8:32 ` Andy Wingo
2010-06-20 14:23 ` Ludovic Courtès
0 siblings, 2 replies; 7+ messages in thread
From: Ludovic Courtès @ 2010-06-17 13:06 UTC (permalink / raw)
To: Ludovic Courtès, bug-guile
URL:
<http://savannah.gnu.org/bugs/?30169>
Summary: Auto-compilation failure of a module doesn't lead
to a failure [1.9.11]
Project: Guile
Submitted by: civodul
Submitted on: Thu 17 Jun 2010 01:06:37 PM GMT
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Consider this example, where auto-compilation of (foo) fails:
#v+
$ cat foo.scm
(define-module (foo))
(open
$ cat bar.scm
(use-modules (foo))
(display "hello!\n")
$ guile -L . bar.scm
;;; note: source file bar.scm
;;; newer than compiled
/home/ludo/.cache/guile/ccache/2.0-0.R-LE-8/home/ludo/src/guile/bar.scm.go
;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0
;;; or pass the --no-autocompile argument to disable.
;;; compiling bar.scm
;;; compiling ./foo.scm
;;; WARNING: compilation of ./foo.scm failed:
;;; key read-error, throw args ("scm_i_lreadparen" "./foo.scm:3:1: end of
file" () #f)
;;; WARNING: compilation of bar.scm failed:
;;; key read-error, throw_args ("scm_i_lreadparen" "./foo.scm:3:1: end of
file" () #f)
hello!
$ echo $?
0
#v-
Guile should instead abort as soon as auto-compilation fails.
Thanks,
Ludo'.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?30169>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [bug #30169] Auto-compilation failure of a module doesn't lead to a failure [1.9.11]
2010-06-17 13:06 [bug #30169] Auto-compilation failure of a module doesn't lead to a failure [1.9.11] Ludovic Courtès
@ 2010-06-18 8:32 ` Andy Wingo
2010-06-18 14:52 ` Ludovic Courtès
2010-06-20 14:23 ` Ludovic Courtès
1 sibling, 1 reply; 7+ messages in thread
From: Andy Wingo @ 2010-06-18 8:32 UTC (permalink / raw)
To: Ludovic Courtès, bug-guile
Hello,
On Thu 17 Jun 2010 15:06, Ludovic Courtès <INVALID.NOREPLY@gnu.org> writes:
> Guile should instead abort as soon as auto-compilation fails.
Guile can fail autocompilation due to eval-when issues for syntax
helpers. Do you want to make Guile fail in this case?
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [bug #30169] Auto-compilation failure of a module doesn't lead to a failure [1.9.11]
2010-06-18 8:32 ` Andy Wingo
@ 2010-06-18 14:52 ` Ludovic Courtès
2010-06-18 17:03 ` Andy Wingo
0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2010-06-18 14:52 UTC (permalink / raw)
To: Andy Wingo; +Cc: bug-guile
Hi,
Andy Wingo <wingo@pobox.com> writes:
> On Thu 17 Jun 2010 15:06, Ludovic Courtès <INVALID.NOREPLY@gnu.org> writes:
>
>> Guile should instead abort as soon as auto-compilation fails.
>
> Guile can fail autocompilation due to eval-when issues for syntax
> helpers. Do you want to make Guile fail in this case?
Sorry, I don’t understand. I want Guile to fail in the example I gave.
Ludo’.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [bug #30169] Auto-compilation failure of a module doesn't lead to a failure [1.9.11]
2010-06-18 14:52 ` Ludovic Courtès
@ 2010-06-18 17:03 ` Andy Wingo
0 siblings, 0 replies; 7+ messages in thread
From: Andy Wingo @ 2010-06-18 17:03 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: bug-guile
On Fri 18 Jun 2010 16:52, ludo@gnu.org (Ludovic Courtès) writes:
> Andy Wingo <wingo@pobox.com> writes:
>
>> On Thu 17 Jun 2010 15:06, Ludovic Courtès <INVALID.NOREPLY@gnu.org> writes:
>>
>>> Guile should instead abort as soon as auto-compilation fails.
>>
>> Guile can fail autocompilation due to eval-when issues for syntax
>> helpers. Do you want to make Guile fail in this case?
>
> Sorry, I don’t understand. I want Guile to fail in the example I gave.
Some files may be interpreted, but fail to compile. They will cause
autocompilation to fail. To be specific, from NEWS:
** Functions needed by macros at expand-time need to be present at
expand-time.
For example, this code will work at the REPL:
(define (double-helper x) (* x x))
(define-macro (double-literal x) (double-helper x))
(double-literal 2) => 4
But it will not work when a file is compiled, because the definition of
`double-helper' is not present at expand-time. The solution is to wrap
the definition of `double-helper' in `eval-when':
(eval-when (load compile eval)
(define (double-helper x) (* x x)))
(define-macro (double-literal x) (double-helper x))
(double-literal 2) => 4
See the documentation for eval-when for more information.
So, you want Guile to fail faster for this error; how do you distinguish
it from eval-when errors as above? Or would you prefer that eval-when
errors lead to failures as well?
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug #30169] Auto-compilation failure of a module doesn't lead to a failure [1.9.11]
2010-06-17 13:06 [bug #30169] Auto-compilation failure of a module doesn't lead to a failure [1.9.11] Ludovic Courtès
2010-06-18 8:32 ` Andy Wingo
@ 2010-06-20 14:23 ` Ludovic Courtès
2010-06-20 20:19 ` Andy Wingo
2010-06-25 15:29 ` Andy Wingo
1 sibling, 2 replies; 7+ messages in thread
From: Ludovic Courtès @ 2010-06-20 14:23 UTC (permalink / raw)
To: Ludovic Courtès, bug-guile
Follow-up Comment #1, bug #30169 (project guile):
(Follow-up from bug-guile.)
Andy says:
> Some files may be interpreted, but fail to compile.
OK.
[...]
> So, you want Guile to fail faster for this error; how do you distinguish
> it from eval-when errors as above? Or would you prefer that eval-when
> errors lead to failures as well?
Do you mean that, for programs written to be interpreted, which lack proper
‘eval-when’ clauses, the idea was to fall back to interpretation when
auto-compilation fails? That would indeed be friendlier to programs written
for previous versions of Guile.
However, in the example I gave, somehow, an error should occur. With 1.8 you
would get an error when reading ‘foo.scm’, whereas here it’s just
silently ignored, which sounds wrong.
Ludo'.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?30169>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [bug #30169] Auto-compilation failure of a module doesn't lead to a failure [1.9.11]
2010-06-20 14:23 ` Ludovic Courtès
@ 2010-06-20 20:19 ` Andy Wingo
2010-06-25 15:29 ` Andy Wingo
1 sibling, 0 replies; 7+ messages in thread
From: Andy Wingo @ 2010-06-20 20:19 UTC (permalink / raw)
To: Ludovic Courtès, bug-guile
Hi,
On Sun 20 Jun 2010 16:23, Ludovic Courtès <INVALID.NOREPLY@gnu.org> writes:
>> So, you want Guile to fail faster for this error; how do you distinguish
>> it from eval-when errors as above? Or would you prefer that eval-when
>> errors lead to failures as well?
>
> Do you mean that, for programs written to be interpreted, which lack proper
> ‘eval-when’ clauses, the idea was to fall back to interpretation when
> auto-compilation fails? That would indeed be friendlier to programs written
> for previous versions of Guile.
Yes, that was the goal.
> However, in the example I gave, somehow, an error should occur. With 1.8 you
> would get an error when reading ‘foo.scm’, whereas here it’s just
> silently ignored, which sounds wrong.
Indeed.
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug #30169] Auto-compilation failure of a module doesn't lead to a failure [1.9.11]
2010-06-20 14:23 ` Ludovic Courtès
2010-06-20 20:19 ` Andy Wingo
@ 2010-06-25 15:29 ` Andy Wingo
1 sibling, 0 replies; 7+ messages in thread
From: Andy Wingo @ 2010-06-25 15:29 UTC (permalink / raw)
To: Ludovic Courtès, Andy Wingo, bug-guile
Follow-up Comment #2, bug #30169 (project guile):
You know, we might consider this to be the same problem as we see here:
$ guile -L .
scheme@(guile-user)> (use-modules (foo))
;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0
;;; or pass the --no-autocompile argument to disable.
;;; compiling /tmp/foo.scm
;;; WARNING: compilation of /tmp/foo.scm failed:
;;; key read-error, throw args ("scm_i_lreadparen" "/tmp/foo.scm:3:1: end of
file" () #f)
Throw to key `read-error':
ERROR: In procedure scm_i_lreadparen:
ERROR: /tmp/foo.scm:3:1: end of file
Entering the debugger. Type `bt' for a backtrace or `c' to continue.
0 debug> c
ERROR: In procedure scm_i_lreadparen:
ERROR: /tmp/foo.scm:3:1: end of file
scheme@(guile-user)> (use-modules (foo))
scheme@(guile-user)>
The second (use-modules (foo)) should not succeed.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?30169>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-06-25 15:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-17 13:06 [bug #30169] Auto-compilation failure of a module doesn't lead to a failure [1.9.11] Ludovic Courtès
2010-06-18 8:32 ` Andy Wingo
2010-06-18 14:52 ` Ludovic Courtès
2010-06-18 17:03 ` Andy Wingo
2010-06-20 14:23 ` Ludovic Courtès
2010-06-20 20:19 ` Andy Wingo
2010-06-25 15:29 ` Andy Wingo
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).