Closed vitusb closed 5 months ago
set TMP=C:\Temp\Perl\strawberry-perl-5.38.2.2-64bit-portable\portableshell.bat..\tmp set TEMP=C:\Temp\Perl\strawberry-perl-5.38.2.2-64bit-portable\portableshell.bat..\tmp
Then try to build an exe, but be warned - removal of files begins under STRAWBERRYPERL's ROOT-Dir !!
Don't do that then.
Seriously, by setting TEMP to a non-existing (even nonsensical) path, all bets are off.
The only recursive file removal in pp
is in script/par.pl
starting on line 194.
Seriously, by setting TEMP to a non-existing (even nonsensical) path, all bets are off.
Okay, but the "path" is existent and due to batch-scripting-logic under windows' "cmd.exe - environment" it is legit to use this awfull mechanism 😸 ...
For example:
C:\Temp>echo.@echo Var01: %~f0 >test.bat
C:\Temp>echo.@echo Var02: %~dp0 >>test.bat
C:\Temp>test.bat
Var01: C:\Temp\test.bat
Var02: C:\Temp\
The expression "%~f0\..\
But you're right ... it is better to use the "%~dp0" - mechanism for referencing objects under "portable conditions" like strawberryperl portable 😄 .
FWIW: I can't reproduce your problem. I installed Strawberry Portable in the same path as you and
upgraded PAR
and PAR::Packer
to their latest versions. Then
set TMP=C:\Temp\Perl\strawberry-perl-5.38.2.2-64bit-portable\portableshell.bat\..\tmp
set TEMP=C:\Temp\Perl\strawberry-perl-5.38.2.2-64bit-portable\portableshell.bat\..\tmp
pp -o hello.exe -E "say 'hello'"
All files under C:\Temp\Perl\strawberry-perl-5.38.2.2-64bit-portable
(checked against the downloaded zip) are accounterd for.
Okay, maybe it's an issue with the environment ... I see, you're using some external tools (i. e. rm, etc. ...); i'm using in my search-path for example busybox for some shell-applet emulations. I already discovered bad side-effects, using old msys 1.0 and busybox shell-tools with incompatible parameters, etc., when executing other Makefiles. Maybe that could be the reason for this issue (plus bad masking of path-separation and so on).
I wil not investigate this further ... Thanx for your support.
Hello,
i discovered a strange behaviour of PAR-Packer (pp) script, when using a PATH-extension to portable tools and directories under Strawberryperl's Portable-ROOT-Path (above c\bin... mingw64-suite) in "portableshell.bat". In order to use these paths, i will use a var "EXEDIR", pointing to this Strawberryperl's Portable-ROOT-Path.
Normally that works fine by using...
As an example, this will point to:
With a:
We will have:
Everything works fine, but when i change EXEDIR with: "set EXEDIR=%~f0.." to:
I will get:
So, with:
This PATH-reference, i get an environment like: ... TEMP=C:\Temp\Perl\strawberry-perl-5.38.2.2-64bit-portable\portableshell.bat\..\tmp TMP=C:\Temp\Perl\strawberry-perl-5.38.2.2-64bit-portable\portableshell.bat\..\tmp ...
Normally that is not a problem, also under a MINGW64 environment, but with an invocation of "pp" under these conditions i will get an error, that an exe-file with a random name unter the temp-dir could not be found or the commandline-prompt hangs (because of deletion-processing in background).
After that error "B.pm", "gcc.exe" inclusive parts of its runtime-helper-binaries under "c\bin..." and other files were deleted.
With a clean PATH for "EXEDIR" without additional "\.." (like my first example above) "pp" works fine.
To reproduce: Simply reference "TEMP" and "TMP" to a construction like:
Then try to build an exe, but be warned - removal of files begins under STRAWBERRYPERL's ROOT-Dir !! Hit immediately ctrl-c to abort, when you encounter a deletion of "portableshell.bat" or "B.pm", etc.. => pp myexample.pl or pp -o myexample.exe myexample.pl