In perl.git, the branch smoke-me/nicholas/116971 has been updated <http://perl5.git.perl.org/perl.git/commitdiff/9c5b8d56084afc9da630a00b5bab6b257f62d1aa?hp=a420522db95b77620564c1be75cece4504eabef1>
- Log ----------------------------------------------------------------- commit 9c5b8d56084afc9da630a00b5bab6b257f62d1aa Author: Nicholas Clark <[email protected]> Date: Wed Mar 6 12:40:01 2013 +0100 t/lib/common.pl should use absolute paths in @INC t/lib/common.pl needs to run test files within a subdirectory, and hence needs change directory into it. Changing a directory poses a problem when running the tests, because @INC is typically '../lib'. The fix for this had been to prepend '../../lib' to @INC, which is the correct relative path while in the subdirectory. However, the END block changes directory upwards (so that it can delete the temporary directory), and in the process of deletion may end up lazy-loading more modules. This will end up searching in ../lib first (ie outside the build directory), which is wrong, and will cause problems if a directory lib/ exists up one level with files of the expected names (eg a lib/ directory from a different version of Perl). Problem identified and diagnosed by Daniel Dragan in RT #116971. ----------------------------------------------------------------------- Summary of changes: t/lib/common.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/t/lib/common.pl b/t/lib/common.pl index e6a33b2..beb59a0 100644 --- a/t/lib/common.pl +++ b/t/lib/common.pl @@ -54,11 +54,11 @@ foreach my $file (@w_files) { } $^X = rel2abs($^X); +@INC = map { rel2abs($_) } @INC; my $tempdir = tempfile; mkdir $tempdir, 0700 or die "Can't mkdir '$tempdir': $!"; chdir $tempdir or die die "Can't chdir '$tempdir': $!"; -unshift @INC, '../../lib'; my $cleanup = 1; END { -- Perl5 Master Repository
