Subject: | core module detection doesn't work with -Duserelocatableinc |
Hi.
If perl was compiled with -Duserelocatableinc then privlib and archlib are relative paths starting with ... which is the directory of the Perl executable. This breaks the detection of core modules.
The following patch fixed the issue for me:
diff --git a/lib/PAR/Packer.pm b/lib/PAR/Packer.pm
index 74e1414..903d61e 100644
--- a/lib/PAR/Packer.pm
+++ b/lib/PAR/Packer.pm
@@ -823,6 +823,15 @@ sub pack_manifest_hash {
(my $privlib = $Config{privlib}) =~ s{\\}{/}g;
(my $archlib = $Config{archlib}) =~ s{\\}{/}g;
+ if($Config{userelocatableinc}){
+ my $perldir = dirname($^X);
+ $privlib =~ s/^\.\.\./$perldir/;
+ $privlib = abs_path($privlib);
+ $self->_vprint(2, "relocatable privlib at $privlib");
+ $archlib =~ s/^\.\.\./$perldir/;
+ $archlib = abs_path($archlib);
+ $self->_vprint(2, "relocatable archlib at $archlib");
+ }
foreach my $pfile (sort grep length $map{$_}, keys %map) {
next if !$opt->{B} and (
($map{$pfile} eq "$privlib/$pfile") or
Regards,
Frank