in reply to Re: Pelr packer pp with -C fails else ok
in thread Pelr packer pp with -C fails else ok

I think the absence of the par-xxx path(s) in @INC is a key symptom. Does your code modify @INC in any way?

What happens if you build an executable that only prints @INC? Like this (adjusting quote chars as needed for linux):

pp -C -e "print join q{ }, @INC"

If I run it on my windows machine using PAR::Packer 1.047, I get the result below. Note the absence of any of the lib dirs from the perl it was built with.

a.exe C:\Users\user\AppData\Local\Temp\par-736861776e\temp-21884\inc\lib C:\ +Users\user\AppData\Local\Temp\par-736861776e\temp-21884\inc CODE(0x38 +59d88) CODE(0x385a310)

Replies are listed 'Best First'.
Re^3: Pelr packer pp with -C fails else ok
by swl (Prior) on Oct 04, 2018 at 22:36 UTC

    The first line of the error also raises questions.

    Invalid argument at -e line 119.

    Can you provide the full text of the pp command you are calling?

    And, a bit more speculatively, does your code call system perl anywhere?

      No, I don't call 'system perl' anywhere and the command is:

      pp -C -M Net::OpenSSH::ShellQuoter::POSIX -M arybase -o mytest mytest.pl

      Yes - the first line is coming from somewhere outside my code. It almost seems like some race condition where the cleanup is happening before any code can execute (or it did but by the time it did some cleanup had already occurred..). The par-temp directory does get created and is empty as expected. Removing the -C works like a charm.

        It could be a race condition where the PAR temp dir is deleted before your code has finished its cleanup or some other step in global destruction (which has no guarantee of order if I remember correctly), but it is difficult to have any certainty without seeing your code. You could put some feedback statements into an end block in your code to get a better sense of when the error is triggered.

        Maybe upgrading to the latest PAR::Packer will also help, but I don't see anything obvious in the change logs.

        In any case, I packed using the command below, and it generates and removes the temp dir as expected.

        pp -C -M Net::OpenSSH::ShellQuoter::POSIX -M arybase -o mytest.exe -e +"print join q{ }, @INC"
        Why do you want to use the big C?
Re^3: Pelr packer pp with -C fails else ok
by dkhosla1 (Sexton) on Oct 06, 2018 at 00:10 UTC
    No, I don't modify @INC anywhere. I will try build a binary to just print @INC and report early next week.