Skip Menu |

This queue is for tickets about the PAR-Packer CPAN distribution.

Report information
The Basics
Id: 104635
Status: resolved
Priority: 0/
Queue: PAR-Packer

People
Owner: RSCHUPP [...] cpan.org
Requestors: MSCHILLI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.025
Fixed in: (no value)



Subject: IO error the first time an executable built by the packer is run on OSX
The packer produces binaries that cause the following error message the first time they're run: IO error: Can't open file /var/folders/_9/ts8bmfyd3wb7nq36_p2fs1p40000gn/T/par-6d736368696c6c69/cache-fd843f52293f9fd2e4c93823729966b52c2d26a6/inc/lib/script for write : Is a directory at -e line 621. Subsequent runs go through without error message. The binary has been both packed and run on OSX 10.8.
On 2015-05-22 21:41:20, MSCHILLI wrote: Show quoted text
> The packer produces binaries that cause the following error message > the first time they're run: > > IO error: Can't open file > /var/folders/_9/ts8bmfyd3wb7nq36_p2fs1p40000gn/T/par- > 6d736368696c6c69/cache- > fd843f52293f9fd2e4c93823729966b52c2d26a6/inc/lib/script for write : Is > a directory at -e line 621. > > > Subsequent runs go through without error message. The binary has been > both packed and run on OSX 10.8.
Sorry, I can't reproduce this on OSX 10.10.3 with system Perl (5.18.2) and latest PAR::Packer, PAR, Module::ScanDeps. What versions are you using? Does this also happen for a "hello world" example, e.g. pp -o hello.exe -e 'print "hello\n"' In any case, could you show the output of unzip -l packed_executable of a packed_executable showing the problem. Cheers, Roderich
I've found a way to reproduce it, try this: mkdir -p lib/Foo eg cat >Foo.pm <<EOT package Foo; use Foo::Bar; sub foo { Foo::Bar->foo(); } 1; EOT cat >lib/Foo/Bar.pm <<EOT package Foo::Bar; sub foo { print "hello\n"; } 1; EOT cat >eg/foo <<EOT #!/usr/bin/perl -w use lib "lib"; use Foo; Foo::foo(); EOT chmod +x eg/foo pp -o broken.exe eg/foo ./broken.exe IO error: Can't open file /var/folders/_9/ts8bmfyd3wb7nq36_p2fs1p40000gn/T//par-6d736368696c6c69/cache-77a96ed9cc9da13b9f275d500f8ec0ed2e7e58a1/inc/lib/foo for write : Is a directory at -e line 953. Seems to be related to the fact that the osx FS won't distinguish between Foo and foo.
On 2015-06-25 14:30:52, MSCHILLI wrote: Show quoted text
> Seems to be related to the fact that the osx FS won't distinguish > between Foo and foo.
Yes, because broken.exe which is also a zip file contains this (using your recipe on Linux, but that shouldn't matter): $ unzip -l broken.exe Archive: broken.exe Length Date Time Name --------- ---------- ----- ---- 0 2015-06-26 10:45 lib/ 0 2015-06-26 10:45 script/ 463 2015-06-26 10:45 MANIFEST 217 2015-06-26 10:45 META.yml 80 2015-06-26 10:45 lib/Foo.pm 71 2015-06-26 10:45 lib/Foo/Bar.pm 55 2015-06-26 10:45 lib/foo 55 2015-06-26 10:45 script/foo 676 2015-06-26 10:45 script/main.pl --------- ------- 1617 9 files The problem is directory lib/Foo (only implied by zip member lib/Foo/Bar.pm) and file lib/foo - these can't coexist on a case-insensitive filesystem. Hmm, but why is lib/foo there at all? The original script is in script/foo. OK, time for some code exegesis... Cheers, Roderich
On 2015-06-26 04:56:15, RSCHUPP wrote: Show quoted text
> OK, time for some code exegesis...
Perhaps the bug is not in PAR::Packer, but rather in Module::ScanDeps (which is used by PAR::Packer to determine what modules etc to "pack in"). $ scandeps.pl -V eg/foo # Foo.pm [module] # Foo/Bar.pm [module] # foo [data] <--- ??? # Legend: [C]ore [X]ternal [S]ubmodule [?]NotOnCPAN 'Foo::Bar' => '0', # ? # Foo 'Foo' => '0', # ? # foo But when I move foo to the cwd: $ scandeps.pl -V foo # Foo.pm [module] # Foo/Bar.pm [module] # Legend: [C]ore [X]ternal [S]ubmodule [?]NotOnCPAN 'Foo::Bar' => '0', # ? # Foo 'Foo' => '0', # ? # foo also $ scandeps.pl -V ./foo # Foo.pm [module] # Foo/Bar.pm [module] # foo [data] <--- ??? # Legend: [C]ore [X]ternal [S]ubmodule [?]NotOnCPAN 'Foo::Bar' => '0', # ? # Foo 'Foo' => '0', # ? # foo The line "# foo [data]" is probably responsible for the spurious zip member lib/foo: $ pp -o good.exe foo $ unzip -l good.exe Archive: good.exe Length Date Time Name --------- ---------- ----- ---- 0 2015-06-29 21:42 lib/ 0 2015-06-29 21:42 script/ 455 2015-06-29 21:42 MANIFEST 215 2015-06-29 21:42 META.yml 80 2015-06-29 21:42 lib/Foo.pm 71 2015-06-29 21:42 lib/Foo/Bar.pm 55 2015-06-29 21:42 script/foo 676 2015-06-29 21:42 script/main.pl --------- ------- 1552 8 files Note: no lib/foo! To be continued. Cheers, Roderich
Fixed in PAR::Packer 1.026. Cheers, Roderich
On Sun Jul 19 09:05:36 2015, RSCHUPP wrote: Show quoted text
> Fixed in PAR::Packer 1.026.
Works perfectly, thanks much!