Bug#840705: libtest-compile-perl: all_pl_files_ok() fails if blib/ directory missing

David Christensen dpchrist at holgerdanske.com
Fri Oct 14 03:08:05 UTC 2016


Package: libtest-compile-perl
Version: 0.17-1
Severity: normal

Dear Maintainer,

I was working on my Perl library when I noticed that
Test::Compile::all_pl_files_ok() failed if the blib/ directory did not
exist:

2016-10-13 19:47:31 dpchrist at t7400 ~/src/Dpchrist-Lib2
$ cat t/compile_pl.t 
use Test::More;
eval "use Test::Compile 0.09";
plan skip_all => "Test::Compile 0.09 required for testing compilation"
 if $@;
all_pl_files_ok();

2016-10-13 19:47:43 dpchrist at t7400 ~/src/Dpchrist-Lib2
$ perl -Ilib t/compile_pl.t 
1..3
not ok 1 - Compile test for script/tsv-to-pdf
#   Failed test 'Compile test for script/tsv-to-pdf'
#   at /usr/share/perl5/Test/Compile.pm line 82.
# script/tsv-to-pdf does not compile
not ok 2 - Compile test for script/tsv-derive-mailing-label-fields
#   Failed test 'Compile test for script/tsv-derive-mailing-label-fields'
#   at /usr/share/perl5/Test/Compile.pm line 82.
# script/tsv-derive-mailing-label-fields does not compile
not ok 3 - Compile test for script/tsv-select-all-by-colno-value
#   Failed test 'Compile test for script/tsv-select-all-by-colno-value'
#   at /usr/share/perl5/Test/Compile.pm line 82.
# script/tsv-select-all-by-colno-value does not compile
# Looks like you failed 3 tests of 3.


But if I run 'make' first to create the blib/ directory, then
all_pl_files_ok() works:

2016-10-13 19:47:53 dpchrist at t7400 ~/src/Dpchrist-Lib2
$ perl Makefile.PL 
Checking if your kit is complete...
Warning: the following files are missing in your kit:
	README
Please inform the author.
Generating a Unix-style Makefile
Writing Makefile for Dpchrist::Lib2
Writing MYMETA.yml and MYMETA.json

2016-10-13 19:47:59 dpchrist at t7400 ~/src/Dpchrist-Lib2
$ make 2>&1 > /dev/null

2016-10-13 19:48:13 dpchrist at t7400 ~/src/Dpchrist-Lib2
$ perl t/compile_pl.t 
1..3
ok 1 - Compile test for script/tsv-to-pdf
ok 2 - Compile test for script/tsv-derive-mailing-label-fields
ok 3 - Compile test for script/tsv-select-all-by-colno-value


So I downloaded the Debian source for Test::Compile:

2016-10-13 19:41:15 dpchrist at t7400 ~/sandbox/debian/wheezy/libtest-compile-perl
$ apt-get source libtest-compile-perl


I made a change to the code set determines the library path when
compiling scripts:

2016-10-13 19:56:29 dpchrist at t7400 ~/sandbox/debian/wheezy/libtest-compile-perl/libtest-compile-perl-0.17/lib/Test
$ diff -u `locate Compile.pm` Compile.pm 
--- /usr/share/perl5/Test/Compile.pm	2012-02-27 13:50:36.000000000 -0800
+++ Compile.pm	2016-10-13 19:56:29.347378684 -0700
@@ -140,7 +140,7 @@
         } else {
             my @perl5lib = split(':', ($ENV{PERL5LIB}||""));
             my $taint = _is_in_taint_mode($file);
-            unshift @perl5lib, 'blib/lib';
+            unshift @perl5lib, (-e 'blib' ? 'blib/lib' : 'lib');
             system($^X, (map { "-I$_" } @perl5lib), "-c$taint", $file);
             return ($? ? 0 : 1);
         }


I made, tested, and installed the patched distribution (I use
local::lib).  Now all_pl_files_ok() works when blib/ does not exist:

2016-10-13 19:49:27 dpchrist at t7400 ~/src/Dpchrist-Lib2
$ l blib
ls: cannot access blib: No such file or directory

2016-10-13 19:59:58 dpchrist at t7400 ~/src/Dpchrist-Lib2
$ perl -Ilib t/compile_pl.t 
1..3
ok 1 - Compile test for script/tsv-to-pdf
ok 2 - Compile test for script/tsv-derive-mailing-label-fields
ok 3 - Compile test for script/tsv-select-all-by-colno-value


David



-- System Information:
Debian Release: 7.11
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages libtest-compile-perl depends on:
ii  libuniversal-require-perl  0.13-1
ii  perl                       5.14.2-21+deb7u4

libtest-compile-perl recommends no packages.

libtest-compile-perl suggests no packages.

-- no debconf information



More information about the pkg-perl-maintainers mailing list