You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When some Perl dependency modules are missing, perlcc does not return an error exit code but a zero code. Worse, it still generates a faulty binary executable that is seldom behaving. I'm using the latest github master branch of this repo (commit 862bdf2). And I'm using Fedora x86_64 Linux with a multi-threaded build of perl 5.24.4. A single-threaded build of perl 5.24.4 also exhibits this problem.
Here's a minimal reproducer:
use Blah;
print"ok";
$ /opt/perl524-thr/bin/perlcc -O2 -S -o b.out b.pl/opt/perl524-thr/bin/perlcc: Unexpected compiler outputCan't locate Blah.pm in @INC (you may need to install the Blah module) (@INC contains: /opt/perl524-thr/lib/site_perl/5.24.4/x86_64-linux-thread-multi /opt/perl524-thr/lib/site_perl/5.24.4 /opt/perl524-thr/lib/5.24.4/x86_64-linux-thread-multi /opt/perl524-thr/lib/5.24.4 .) at b.pl line 1. BEGIN failed--compilation aborted at b.pl line 1.
$ echo$?0
$ ./b.out
And the following patch fixes this:
diff --git a/script/perlcc.PL b/script/perlcc.PL
index b62371f5..13269bed 100644
--- a/script/perlcc.PL+++ b/script/perlcc.PL@@ -465,6 +465,9 @@ sub compile_byte {
} else {
my @error = grep { !/^$Input syntax OK$/o } @$error_r;
@error = grep { !/^No package specified for compilation, assuming main::$/o } @error;
+ if (grep { /Can't locate \S+ in \@INC \(/ } @error) {+ die "$0: Missing Perl modules\n@error";+ }
warn "$0: Unexpected compiler output\n@error" if @error and opt('v')<5;
warn "@error" if @error and opt('v')>4;
}
@@ -590,6 +593,9 @@ sub compile_cstyle {
if (opt('check')) {
print "@error" if @error;
} else {
+ if (grep { /Can't locate \S+ in \@INC \(/ } @error) {+ die "$0: Missing Perl modules\n@error";+ }
warn "$0: Unexpected compiler output\n@error" if @error and opt('v')<5;
warn "@error" if @error and opt('v')>4;
}
Does it look good enough?
The text was updated successfully, but these errors were encountered:
When some Perl dependency modules are missing,
perlcc
does not return an error exit code but a zero code. Worse, it still generates a faulty binary executable that is seldom behaving. I'm using the latest github master branch of this repo (commit 862bdf2). And I'm using Fedora x86_64 Linux with a multi-threaded build of perl 5.24.4. A single-threaded build of perl 5.24.4 also exhibits this problem.Here's a minimal reproducer:
And the following patch fixes this:
Does it look good enough?
The text was updated successfully, but these errors were encountered: