Randy W. Sims wrote:
The problem here is what to return. Most failures in M::B generate
exceptions (i.e. die). This is one way that tools that use the automated
interface know when something bad happens (and why your C<exit> approach
probably wont work). Another problem is that actions call other actions
which call other actions (see sig for 1st level dependencies). Simple
return values wont work or be meaningfull here. If we do decide to do
something different here, the only remaining option that might be
workable is creating some "smart" exception objects to throw around,
which can propagate up the stack and retain some meaningfull semantic
information.
Hmmm. I'm not clear what the difference is from an external
perspective. Doesn't die just exit with a non-zero value after printing
a bunch of stuff to STDERR? If something like distcheck fails, right
now, neither an internal or external caller ever find out -- the only
hint is what's printed to screen by ExtUtils::Manifest. Using "exit"
just avoids printing a bunch of additional stuff to the screen while
exiting. Er, I guess if there *were* any exception handling, we'd want
to die instead so it could be caught. Maybe that's the point.
In general, anything going through Test::Harness/Builder winds up
exiting with a meaningful error value (number of tests failed) because
the END blocks in that code set the exit value property, so
Module::Build generally is relying on that behavior. (E.g. "testpod")
But for everything else, since return values aren't checked, the only
options are "exit" or "die".
I don't see what the dependencies have to do with it -- neither depends
nor dispatch check for a return. Right now, it's die or nothing, so
adding another die/exit shouldn't matter, except that it makes sure that
external programs don't think everything is fine when something like
distcheck fails.
David
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
|