[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
recent debian perl tests failures without . in @INC
From: |
Patrice Dumas |
Subject: |
recent debian perl tests failures without . in @INC |
Date: |
Tue, 29 Aug 2017 11:48:17 +0200 |
User-agent: |
Mutt/1.5.20 (2009-12-10) |
Hello,
Recent perl in debian do not have . in @INC anymore, and it will be
upstream in perl 5.26.
https://lists.debian.org/debian-devel-announce/2016/08/msg00013.html
As a consequence some tests now fail, even with top_srcdir set:
top_srcdir=../
export top_srcdir
perl t/accents.t
Can't locate Texinfo/ModulePath.pm in @INC (you may need to install the
Texinfo::ModulePath module) (@INC contains:
/home/dumas/perl5/lib/perl5//x86_64-linux-gnu-thread-multi
/home/dumas/perl5/lib/perl5/ /etc/perl
/usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1
/usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5
/usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24
/usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at t/accents.t
line 4.
Other tests, such as t/01use.t work, though only if top_srcdir is set.
Using -I . option to perl makes the test work again (even if
top_srcdir is not set), like:
perl -I . t/accents.t
It seems to me that the difference between tests that work and tests
that do not is the presence or not, in BEGIN block of
if (defined($ENV{'top_srcdir'})) {unshift @INC,
File::Spec->catdir($ENV{'top_srcdir'}, 'tp');
It seems to me that Texinfo/ModulePath.pm is generated so will be in the
build directory, and that it can set top_srcdir carefully, not
overwriting it if not needed. It would also probably be good to have
tests working even if top_srcdir is not set.
One possibility could be to add something like the following in every
test:
BEGIN {
if (not (grep {$_ eq '.'} @INC)) {push @INC, '.';}
}
And maybe the line:
if (defined($ENV{'top_srcdir'})) {unshift @INC,
File::Spec->catdir($ENV{'top_srcdir'}, 'tp');
could be removed, but maybe with a comment stating that it will only
work for out of source builds if Texinfo/ModulePath.pm is generated in
the build tree.
--
Pat
- recent debian perl tests failures without . in @INC,
Patrice Dumas <=