Skip Menu |

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

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

People
Owner: RSCHUPP [...] cpan.org
Requestors: morry.davis [...] sbcglobal.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.002
Fixed in: (no value)



Subject: can'r wrtie file
C:\Users\morry\Desktop>pp -o c:/Users/morry/startup.exe startup.pl Set up gcc environment - 3.4.5 (mingw-vista special r3) C:\Perl\site\bin/pp: Cannot write in this directory: No such file or directory Not sure what directory it's trying to write in. C:\Users\morry\Desktop>perl -V Set up gcc environment - 3.4.5 (mingw-vista special r3) Summary of my perl5 (revision 5 version 12 subversion 1) configuration: Platform: osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='C:/Perl/site/bin/gcc.exe', ccflags ='-DNDEBUG -DWIN32 -D_CONSOLE -DNO_S RICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLI IT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing - ms-bitfields', optimize='-O2', cppflags='-DWIN32' ccversion='', gccversion='3.4.5 (mingw-vista special r3)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeks ze=8 alignbytes=8, prototype=define Linker and Libraries: ld='C:\Perl\site\bin\g++.exe', ldflags ='-L"C:\Perl\lib\CORE"' libpth=\lib libs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 lodbccp32 -lcomctl32 -lmsvcrt perllibs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshe l32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodb 32 -lodbccp32 -lcomctl32 -lmsvcrt libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl512.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-mdll -L"C:\Perl\lib\CORE"' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF USE_SITECUSTOMIZE Locally applied patches: ActivePerl Build 1201 [292674] d956618 Make Term::ReadLine::findConsole fall back to STDIN if /dev/tty can't be opened 321e50c Escape patch strings before embedding them in patchlevel.h Built under MSWin32 Compiled at May 14 2010 00:34:27 @INC: C:/Perl/site/lib C:/Perl/lib .
On 2011-04-21 19:55:07, morrydavis wrote: Show quoted text
> C:\Users\morry\Desktop>pp -o c:/Users/morry/startup.exe startup.pl > C:\Perl\site\bin/pp: Cannot write in this directory: No such file or > directory > > Not sure what directory it's trying to write in.
Your working directory. There were several places where File::Temp::tempfile was called with a template parameter, but _without_ TMPDIR => 1, so that it tries to generate the temporary file in the working directory. File::Temp, you suck! Please try the attached patch (apply it to an unpacked CPAN tarball, then rebuild PAR::Packer). Cheer, Roderich
Subject: rt67681.patch
diff -ubr a/lib/PAR/Packer.pm b/lib/PAR/Packer.pm --- a/lib/PAR/Packer.pm 2010-11-21 17:39:23.000000000 +0100 +++ b/lib/PAR/Packer.pm 2011-04-22 18:42:22.932576126 +0200 @@ -191,9 +191,6 @@ if (-e _) { $self->_die("Cannot write on $file: $!\n") unless -w _; } - unless (-w Cwd::cwd()) { - $self->_die("Cannot write in this directory: $!\n"); - } } } @@ -309,8 +306,8 @@ $self->_warn("Using -e 'code' as input file, ignoring @$args\n") if (@$args and !$opt->{r}); - my ($fh, $fake_input) = - File::Temp::tempfile("ppXXXXX", SUFFIX => ".pl", UNLINK => 1); + my ($fh, $fake_input) = File::Temp::tempfile( + "ppXXXXX", SUFFIX => ".pl", TMPDIR => 1, UNLINK => 1); print $fh $opt->{e}; close $fh; @@ -633,7 +630,8 @@ # Don't need to keep it, be safe with a tempfile. $self->{pack_attrib}{lose} = 1; - ($cfh, $par_file) = File::Temp::tempfile("ppXXXXX", SUFFIX => ".par"); + ($cfh, $par_file) = File::Temp::tempfile( + "ppXXXXX", SUFFIX => ".par", TMPDIR => 1, UNLINK => 1); close $cfh; # See comment just below } $self->{par_file} = $par_file; @@ -1299,9 +1297,8 @@ $self->_vprint(0, "Generating a fresh 'parl'."); my ($fh, $filename) = File::Temp::tempfile( - "parlXXXXXXX", - SUFFIX => $Config{_exe}, - ); + "parlXXXXXXX", SUFFIX => $Config{_exe}, TMPDIR => 1, UNLINK => 1); + close $fh; my $success = $class->write_parl($filename); if (not $success) { @@ -1349,10 +1346,7 @@ my $cfh; my $fh = $self->_open($self->{parl}); ($cfh, $self->{parl}) = File::Temp::tempfile( - "parlXXXX", - SUFFIX => ".exe", - UNLINK => 1, - ); + "parlXXXX", SUFFIX => ".exe", TMPDIR => 1, UNLINK => 1); binmode($cfh); local $/; diff -ubr a/lib/PAR/StrippedPARL/Base.pm b/lib/PAR/StrippedPARL/Base.pm --- a/lib/PAR/StrippedPARL/Base.pm 2010-11-21 17:37:32.000000000 +0100 +++ b/lib/PAR/StrippedPARL/Base.pm 2011-04-22 18:39:58.688493279 +0200 @@ -53,10 +53,7 @@ # write out to a temporary file first my ($fh, $tfile) = File::Temp::tempfile( - "parlXXXX", - SUFFIX => $Config::Config{_exe}||'', - DIR => File::Spec->tmpdir(), - ); + "parlXXXX", SUFFIX => $Config::Config{_exe}||'', TMPDIR => 1); close $fh; # File::Temp, you suck!
Comitted the patch, will be in the next release of PAR::Packer