From a462003e1b0ecd74d52837c88aa79db4ff49fce8 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Wed, 4 Dec 2013 05:46:40 -0800 Subject: Do not clobber @INC completely in buildcustomize.pl buildcustomize.pl (for miniperl) replaces @INC (usually qw(lib .)) with the whole list of build directories we need followed by qw(lib .). runperl from test.pl is such that this: runperl(switches => [ "-Irun/flib" ], ...) turns into: /path/to/perl.git/miniperl "-I../lib" -Irun/flib The end result is that -Irun/flib gets stripped out and clobbered, and switchM.t fails under minitest. --- write_buildcustomize.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'write_buildcustomize.pl') diff --git a/write_buildcustomize.pl b/write_buildcustomize.pl index 20ac532344..3f78264a7a 100644 --- a/write_buildcustomize.pl +++ b/write_buildcustomize.pl @@ -47,7 +47,7 @@ require File::Spec::Functions; my $inc = join ",\n ", map { "q\0$_\0" } - (map {File::Spec::Functions::rel2abs($_)} @toolchain, 'lib'), '.'; + (map {File::Spec::Functions::rel2abs($_)} @toolchain, 'lib'); open my $fh, '>', $file or die "Can't open $file: $!"; @@ -65,9 +65,9 @@ print $fh <<"EOT" or $error = "Can't print to $file: $!"; # Any changes made here will be lost! # We are miniperl, building extensions -# Reset \@INC completely, adding the directories we need, and removing the -# installed directories (which we don't need to read, and may confuse us) -\@INC = ($inc); +# Replace the first entry of \@INC ("lib") with the list of +# directories we need. +splice(\@INC, 0, 1, $inc); EOT if ($error) { -- cgit v1.2.1