Mon Feb 08 03:46:09 2010: Request 42986 was acted upon.
Transaction: Correspondence added by SMUELLER
Queue: PAR
Subject: Re: [rt.cpan.org #42986] PAR-based modules use system XS modules
over included modules
Broken in: 0.984
Severity: Important
Owner: Nobody
Requestors: [email protected]
Status: open
Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=42986 >
Hi Toby, hi Roderich,
RSCHUPP via RT wrote:
> Queue: PAR
> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=42986 >
> I think what happens is a kind of chicken and egg problem:
>
> - your .par contains different versions of File::Temp etc
> than installed on the target machine
>
> - conceptually we would like "perl -MPAR foo.par"
> to behave like
> - extract file.par into temporary directory /tmp/foo123
> - run "perl -I/tmp/foo123 /tmp/foo123/foo.pl"
> (i.e. "/tmp/foo123" is at the start of @INC)
>
> - in order to get to the modules in the .par file, PAR.pm
> needs some modules, e.g. File::Temp
>
> - hence it already has loaded the target system's File::Temp
> before it even gets to consider the (different) copy included
> in the .par
>
> All modules cited in your report are in this category
> "required by PAR.pm to extract stuff from a .par file".
> (Digest::SHA1 is a special case that's even weirder.)
>
> Sorry, I see no sane way to make this work.
I agree. No sane way. But you may try to do something like this. I would
probably not do it in production.
- Pack Class::Unload into your .par.
- Load the .par file (using system File::Temp)
- Load Class::Unload.
- Extract File/Temp.pm from the .par file into the appropriate location
of the temporary storage location. Just have a look, the layout is
basically a normal lib/ dir. PAR.pm has hooks for loading the contents
of a file from any loaded .par file.
- Run Class::Unload->unload('File::Temp')
- require File::Temp
This may or may not work. It's certainly one of the uglier hacks I've
suggested in the past.
Best regards,
Steffen