[rt.cpan.org #130685] core module detection doesn't work with -Duserelocatableinc
[email protected] ("Frank Lichtenheld via RT") Thu, 10 Oct 2019 04:37:25 -0400
| Newsgroups | perl.par |
|---|---|
| Message-ID | <[email protected]> |
Thu Oct 10 04:37:24 2019: Request 130685 was acted upon. Transaction: Ticket created by [email protected] Queue: PAR-Packer Subject: core module detection doesn't work with -Duserelocatableinc Broken in: 1.049 Severity: Important Owner: Nobody Requestors: [email protected] Status: new Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=130685 > 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