Subject: | test uses wrong Perl when running script/pkg-config.pl |
The test suite that comes with this distribution uses /usr/bin/perl to execute script/pkg-config.pl, which may not be the correct version of Perl. This patch fixed it for me:
iscah% git diff HEAD^
diff --git a/t/PkgConfigTest.pm b/t/PkgConfigTest.pm
index f5e987a..cd71bed 100644
--- a/t/PkgConfigTest.pm
+++ b/t/PkgConfigTest.pm
@@ -40,7 +40,7 @@ our $S;
my $SCRIPT = __DIR__ . "/../script/pkg-config.pl";
sub run_common {
my @args = @_;
- (my $ret = qx($SCRIPT --env-only @args))
+ (my $ret = qx($^X $SCRIPT --env-only @args))
=~ s/(?:^\s+)|($?:\s+$)//g;
$RV = $?;
$S = $ret;
@@ -149,4 +149,4 @@ sub run_flags_test {
}
}
-1;
\ No newline at end of file
+1;
I noticed this because I had upgraded Encode into a directory located in PERL5LIB and was seeing this error:
iscah% make test |&head
PERL_DL_NONLAZY=1 /home/ollisg/opt/perl/5.18.2/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
# Testing PkgConfig 0.05020, Perl 5.018002, /home/ollisg/opt/perl/5.18.2/bin/perl
t/00-load.t ............... ok
Constant subroutine main::__DIR__ redefined at /home/ollisg/perl5/5.18.2/dev/lib/perl5/Dir/Self.pm line 31.
Can't load '/home/ollisg/perl5/5.18.2/dev/lib/perl5/x86_64-linux/auto/Encode/Encode.so' for module Encode: /home/ollisg/perl5/5.18.2/dev/lib/perl5/x86_64-linux/auto/Encode/Encode.so: undefined symbol: PL_stack_sp at /usr/share/perl/5.14/XSLoader.pm line 71.
at /home/ollisg/perl5/5.18.2/dev/lib/perl5/x86_64-linux/Encode.pm line 10.
Compilation failed in require at /home/ollisg/perl5/5.18.2/dev/lib/perl5/Pod/Text.pm line 32.
BEGIN failed--compilation aborted at /home/ollisg/perl5/5.18.2/dev/lib/perl5/Pod/Text.pm line 32.
Compilation failed in require at (eval 6) line 2.
BEGIN failed--compilation aborted at /home/ollisg/perl5/5.18.2/dev/lib/perl5/Pod/Usage.pm line 29.