Discussion:
[e-lang] Patch for review: show updoc errors immediately
Thomas Leonard
2011-09-21 13:37:04 UTC
Permalink
One problem I frequently hit with updoc is that it doesn't report errors
until the script finishes. But, often, the error prevents the script
from finishing. Then you have to bisect the script manually until you
see the error.

As a simple test case, consider:

? def a
? bind a = 3
? interp.waitAtTop(a)
? a
# value: 3

This script (which contains a syntax error on the second line), will
silently hang:

$ rune demo.updoc

updoc: started

/tmp/demo.updoc:..
[ hangs ]


With this patch, it reports the error:

$ rune demo.updoc

updoc: started

/tmp/demo.updoc:...
at: <file:/tmp/demo.updoc#:span::3:4::3:13>
expr: bind a = 3
missing original syntax error
new syntax error: use ':=' for assignment, or '==' for equality


Another side-effect of this is that if the abortEarly flag is set by a
test case, the tests do actually abort.

Patch:

http://gitorious.org/~tal-itinnov/repo-roscidus/it-innovation/commit/dca612f2a472451881c00ea02e290a398a92b22e
--
Dr Thomas Leonard
IT Innovation Centre
Gamma House, Enterprise Road,
Southampton SO16 7NS, UK


tel: +44 23 8059 8866

mailto:***@it-innovation.soton.ac.uk
http://www.it-innovation.soton.ac.uk/
Thomas Leonard
2011-09-26 10:16:45 UTC
Permalink
Post by Thomas Leonard
One problem I frequently hit with updoc is that it doesn't report errors
until the script finishes. But, often, the error prevents the script
from finishing. Then you have to bisect the script manually until you
see the error.
[...]
Post by Thomas Leonard
http://gitorious.org/~tal-itinnov/repo-roscidus/it-innovation/commit/dca612f2a472451881c00ea02e290a398a92b22e
Any objections to me committing this today?
--
Dr Thomas Leonard
IT Innovation Centre
Gamma House, Enterprise Road,
Southampton SO16 7NS, UK


tel: +44 23 8059 8866

mailto:***@it-innovation.soton.ac.uk
http://www.it-innovation.soton.ac.uk/
Kevin Reid
2011-09-26 11:29:29 UTC
Permalink
Post by Thomas Leonard
Post by Thomas Leonard
One problem I frequently hit with updoc is that it doesn't report errors
until the script finishes. But, often, the error prevents the script
from finishing. Then you have to bisect the script manually until you
see the error.
[...]
Post by Thomas Leonard
http://gitorious.org/~tal-itinnov/repo-roscidus/it-innovation/commit/dca612f2a472451881c00ea02e290a398a92b22e
Any objections to me committing this today?
Sorry, I was waiting on having time to review the existing architecture of makeScriptPlayer and didn't get around to it. I do agree that reporting errors immediately is important for the reason you gave.

Your change looks good overall, except that there should be @param docs for the 'out' parameters you added. Please add those before committing.


Also, another nice thing to have would be to add an option to additionally print the individual steps as they are executing (so that finding a hung/lost-signal test is not a matter of counting dots). Or, since the evaluation occurs in a separate vat from the updoc replay (if I recall correctly), have a timeout after which the step is printed and reported as hung.
--
Kevin Reid <http://switchb.org/kpreid/>
Thomas Leonard
2011-09-26 13:49:50 UTC
Permalink
Post by Kevin Reid
Post by Thomas Leonard
Post by Thomas Leonard
One problem I frequently hit with updoc is that it doesn't report errors
until the script finishes. But, often, the error prevents the script
from finishing. Then you have to bisect the script manually until you
see the error.
[...]
Post by Thomas Leonard
http://gitorious.org/~tal-itinnov/repo-roscidus/it-innovation/commit/dca612f2a472451881c00ea02e290a398a92b22e
Any objections to me committing this today?
Sorry, I was waiting on having time to review the existing architecture of makeScriptPlayer and didn't get around to it. I do agree that reporting errors immediately is important for the reason you gave.
Done.
Post by Kevin Reid
Also, another nice thing to have would be to add an option to additionally print the individual steps as they are executing (so that finding a hung/lost-signal test is not a matter of counting dots). Or, since the evaluation occurs in a separate vat from the updoc replay (if I recall correctly), have a timeout after which the step is printed and reported as hung.
You can print the steps with: -Dupdoc.trace=true
--
Dr Thomas Leonard
IT Innovation Centre
Gamma House, Enterprise Road,
Southampton SO16 7NS, UK


tel: +44 23 8059 8866

mailto:***@it-innovation.soton.ac.uk
http://www.it-innovation.soton.ac.uk/
Kevin Reid
2011-09-26 14:15:39 UTC
Permalink
Post by Thomas Leonard
Post by Kevin Reid
Also, another nice thing to have would be to add an option to additionally print the individual steps as they are executing (so that finding a hung/lost-signal test is not a matter of counting dots). Or, since the evaluation occurs in a separate vat from the updoc replay (if I recall correctly), have a timeout after which the step is printed and reported as hung.
You can print the steps with: -Dupdoc.trace=true
OK, needs documenting. Could you write up what you know in a section something like "Running Updoc scripts" in <http://wiki.erights.org/wiki/Updoc>? I'll work on it myself later, but I'm a bit busy today.
--
Kevin Reid <http://switchb.org/kpreid/>
Loading...