-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #86 "-l somelib.dll doesn't work in recent PAR::Packer versions"
par_setup_libpath() in myldr/mktmpdir.c used to set all known "search path for DLLs" environment variables (e.g. LD_LIBRARY_PATH on Linux). The search path is set up so that the first directory searched is a packed executable's cache directory (where the shared perl library will be extracted to, also all packed "external" DLLs). In 2017 (by 2ac7078) it was changed to only set the variable relevant for the OS where PAR::Packer was build on, given by $Config{ldlibpthname}. But some perl distributions (e.g. Strawberry on Windows) do not specify $Config{ldlibpthname}. Hardwire "PATH" for MSWin32 and otherwise complain if this Config variable is undefined. Add t/85-ldlibpthname.t: check that the value of the environment variable for searching for DLLs, usually $ENV{$Config{ldlibpthname}}, starts with the cache directory, $ENV{PAR_TEMP}.
- Loading branch information
Showing
7 changed files
with
57 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/perl -w | ||
|
||
use strict; | ||
use Config; | ||
use Data::Dumper; | ||
|
||
use Test::More; | ||
require "./t/utils.pl"; | ||
|
||
my $ldlibpthname = $^O eq 'MSWin32' ? "PATH" : $Config{ldlibpthname}; | ||
|
||
plan skip_all => "\$Config{ldlibpthname} is not available for your OS ($^O)" unless $ldlibpthname; | ||
plan tests => 3; | ||
|
||
my $exe = pp_ok(-e => <<"..."); | ||
use Data::Dumper; | ||
my \$data = { | ||
par_temp => \$ENV{PAR_TEMP}, | ||
ldlibpth => \$ENV{$ldlibpthname}, | ||
}; | ||
print Data::Dumper->new([\$data], ['data'])->Indent(1)->Useqq(1)->Dump(); | ||
... | ||
|
||
my ($out) = run_ok($exe); | ||
our $data; | ||
eval $out; | ||
ok($data->{ldlibpth} =~ /^\Q$data->{par_temp}\E($|\Q$Config{path_sep}\E)/, | ||
"PAR_TEMP is first item in $ldlibpthname as seen by packed executable") | ||
or diag($out); | ||
|
||
|