Fix perl searchpath for modern perl for MSVC tools
authorAndrew Dunstan <[email protected]>
Sun, 28 Oct 2018 16:22:32 +0000 (12:22 -0400)
committerAndrew Dunstan <[email protected]>
Sun, 28 Oct 2018 16:26:14 +0000 (12:26 -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 bde5b7c793a28dd3f1c18209604c746a23a7d025..d7b7c7ee615a59f1339cc5eb9fcf7fdf5b4d57df 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 6f1c42e504449ea56330b190c3d2c3400fa9c5e4..748b0eb41563b1ca786ffd745a181959b3d1059b 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 055941c69b9adf3d8d287eb468d782ba3746edc6..b5699d1b45253390d1d94c677797c1e30bbad351 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);