Tue Feb 03 00:35:06 2009: Request 42986 was acted upon.
Transaction: Ticket created by TJC
       Queue: PAR
     Subject: PAR-based modules use system XS modules over included modules
   Broken in: 0.984
    Severity: Important
       Owner: Nobody
  Requestors: [email protected]
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=42986 >


I have created a PAR file which contains my script, and the included
modules include an XS module.
However if I try to run the script, the XS module fails to load with
DynaLoader, as the system-installed .so file has been loaded, rather
than the one included with the PAR file.

To give an example:
test.pl contains:
#!/usr/bin/perl
use strict;
use warnings;
use Template;
my $foo = Template->new({STASH => 'Template::Stash::XS'});

I create a par like so:
pp -p -o test.par test.pl

I verify that the contents of the PAR contain Template/Stash/XS.pm and
Template/Stash/XS.so, and that they are version 2.20.

Now I attempt to run the PAR on a machine with version 2.19 of the above
installed, and get:

$ parl test.par test.pl
Failed to initialise Template: failed to create context: failed to
create context: failed to load Template/Stash/XS.pm: Couldn't load
Template::Stash::XS 2.20:

Template::Stash::XS object version 2.19 does not match bootstrap
parameter 2.20 at /usr/lib/perl/5.10.0/DynaLoader.pm line 219.


I may be making a mistake here of course!


This is tested on:
Perl 5.10.0
PAR 0.984
PAR::Packer 0.982
AutoLoader 5.68
PAR::Dist 0.43

Reply via email to