In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/96d268e2f48e69b4cb65326df6690ffc21120f3c?hp=ec3fc3c1a6073e4315330c1e2a9df8a0d5d9fdb3>
- Log ----------------------------------------------------------------- commit 96d268e2f48e69b4cb65326df6690ffc21120f3c 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
