Fix perl searchpath for modern perl for MSVC tools
authorAndrew Dunstan
Sun, 28 Oct 2018 16:22:32 +0000 (12:22 -0400)
committerAndrew Dunstan
Sun, 28 Oct 2018 16:25:10 +0000 (12:25 -0400)
Modern versions of perl no longer include the current directory in the
perl searchpath, as it's insecure. Instead of adding the current
directory, we get around the problem by adding the directory where the
script lives.

Problem noted by Victor Wagner.

Solution adapted from buildfarm client code.

Backpatch to all live versions.

src/tools/msvc/install.pl
src/tools/msvc/mkvcbuild.pl
src/tools/msvc/vcregress.pl

index b2d7f9e040b4d774d57e406ebf8b7e3179f14ecc..90425ca8fc68ebe70cfe41031f8c846d421ae67f 100755 (executable)
@@ -6,6 +6,10 @@
 use strict;
 use warnings;
 
+use File::Basename;
+use File::Spec;
+BEGIN  { use lib File::Spec->rel2abs(dirname(__FILE__)); }
+
 use Install qw(Install);
 
 # buildenv.pl is for specifying the build environment settings
index 9255dff022d0f23d8c7bf1b89415ce1c70f5fccf..34e861375c00652c272e035806627bd922603a31 100644 (file)
@@ -7,6 +7,10 @@
 use strict;
 use warnings;
 
+use File::Basename;
+use File::Spec;
+BEGIN  { use lib File::Spec->rel2abs(dirname(__FILE__)); }
+
 use Mkvcbuild;
 
 chdir('..\..\..') if (-d '..\msvc' && -d '..\..\..\src');
index d4f61c7b3fded25209676ec5cc9167427123904b..5227023ad0c1b1bb95d0e72146816b70236bb920 100644 (file)
@@ -10,6 +10,8 @@ use Cwd;
 use File::Basename;
 use File::Copy;
 use File::Find ();
+use File::Spec;
+BEGIN  { use lib File::Spec->rel2abs(dirname(__FILE__)); }
 
 use Install qw(Install);