Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^3: Symlinks with PAR::Packer not working on Windows

by swl (Vicar)
on Jul 08, 2021 at 22:21 UTC ( #11134818=note: print w/replies, xml ) Need Help??

in reply to Re^2: Symlinks with PAR::Packer not working on Windows
in thread Symlinks with PAR::Packer not working on Windows

Do you get the same problem if you only pack one script?

Also, it would be useful to output the contents of some of the PAR environment variables to see what PAR thinks it is dealing with, for example PAR_0, PAR_PROGNAME and PAR_GLOBAL_TEMP. See PAR::Environment. That's assuming it gets that far, of course.

use 5.010; say $ENV{PAR_0}; say $ENV{PAR_PROGNAME}; say $ENV{PAR_GLOBAL_TEMP}; say $0;

More generally, in the past when I've packed multiple scripts I usually packed the first (child) script as an exe, and then included that as an extra file resource when packing the parent script (using the --addfile argument). The parent script can use logic based on $ENV{PAR_0} to decide if it should call a perl script or a packed executable. Any packed resource will be under $ENV{PAR_TMP}/inc.

This approach leads to duplication in what is packed because dependencies are packed separately in each exe. However, it is simpler to wrangle and duplication is not really an issue unless there are large dependencies.

Replies are listed 'Best First'.
Re^4: Symlinks with PAR::Packer not working on Windows
by kaldor (Sexton) on Jul 09, 2021 at 19:25 UTC

    I get the same result when packing a single or multiple scripts.

    Using set PAR_DEBUG=999 or say $ENV{PAR_*} (good advice, by the way) doesn't change the output.

    About your technique of packing child/parent scripts as .exe, doesn't it also duplicate the perl interpreter? The executable's size with a single empty script is already about 8MB, I'm afraid it would result in a huge file.

      It looks like the system does not get so far as to be able to run any code, as pointed to in the code link in 11134827.

      In terms of packing exes in exes, their contents are independent so the perl interpreter will be duplicated. Whether one considers 8MB (or 64MB) huge is a matter of context, e.g. whether the target systems are resource constrained or not.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11134818]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2021-10-18 05:43 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (72 votes). Check out past polls.