In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/af26e4f23ae11a43d1a3ac56ed110a974e093811?hp=5df8ece29fd957870ec28e269ef416b1536e92d0>
- Log ----------------------------------------------------------------- commit af26e4f23ae11a43d1a3ac56ed110a974e093811 Author: Father Chrysostomos <[email protected]> Date: Sun Aug 31 18:20:28 2014 -0700 perl.c: Improve buildcustomize error message buildcustomize.pl was being loaded with generated code that died if âlib/buildcustomize.plâ existed but do-file failed. $@ was used as the error message. If the file does not exist (do-file searching @INC), then $@ is empty and the error is in $!. Before 9054c817, this is what we would get: $ ./miniperl -T -Ilib -e0 Died. BEGIN failed--compilation aborted. I fixed that in 9054c817 so there would be no error (by adding an ini- tial â./â to the path.) That message was rather baffling. It would have been easier to track down the cause if I had seen something like this: $ ./miniperl -T -Ilib -e0 lib/buildcustomize.pl: No such file or directory. BEGIN failed--compilation aborted. This commit changes the generated code to output $! like that if $@ is empty, in case a similar bug occurs again. ----------------------------------------------------------------------- Summary of changes: perl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/perl.c b/perl.c index 4af5348..b61e2ff 100644 --- a/perl.c +++ b/perl.c @@ -2070,10 +2070,9 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit) it should be reported immediately as a build failure. */ (void)Perl_av_create_and_unshift_one(aTHX_ &PL_preambleav, Perl_newSVpvf(aTHX_ - "BEGIN { do {local $!; -f q%c./%"SVf - "/buildcustomize.pl%c} and do q%c./%"SVf - "/buildcustomize.pl%c || die $@ }", - 0, SVfARG(*inc0), 0, + "BEGIN { my $f = q%c./%"SVf"/buildcustomize.pl%c; " + "do {local $!; -f $f }" + " and do $f || die $@ || qq '$f: $!' }", 0, SVfARG(*inc0), 0)); } # else -- Perl5 Master Repository
