Discussion:
[rt.cpan.org #123232] commandline arguments under windows
(too old to reply)
Josef Gruber via RT
2017-10-10 10:27:46 UTC
Permalink
Tue Oct 10 06:27:44 2017: Request 123232 was acted upon.
Transaction: Ticket created by ***@documatrix.com
Queue: PAR
Subject: commandline arguments under windows
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: ***@documatrix.com
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=123232 >


Hello,
I use pp in the windows environment:
call pp -X customer.pm -M MIME::Lite -M Crypt::DES_EEE3 -l
libatomic-1.dll -l libbz2-1_.dll -l libcharset-1_.dll -l
libcrypto-1_1_.dll -l libdb-6.2_.dll -l libexpat-1_.dll -l
libexslt-0_.dll -l libffi-6_.dll -l libfreeglut_.dll -l
libfreetype-6_.dll -l libgcc_s_dw2-1.dll -l libgd-3_.dll -l
libgdbm-4_.dll -l libgdbm_compat-4_.dll -l libgfortran-4.dll -l
libgif-7_.dll -l libgomp-1.dll -l libiconv-2_.dll -l libjpeg-9_.dll -l
liblzma-5_.dll -l libmysql_.dll -l libpng16-16_.dll -l libpq_.dll -l
libquadmath-0.dll -l libssh2-1_.dll -l libssl-1_1_.dll -l libssp-0.dll
-l libstdc++-6.dll -l libt1-5_.dll -l libtiff-5_.dll -l libtiffxx-5_.dll
-l libwinpthread-1.dll -l libxml2-2_.dll -l libXpm_.dll -l
libxslt-1_.dll -l zlib1_.dll  copyZip.pl -o
m:\kunden\ISTA\Kaltmiete\customize\copyZipW32.exe

The executeable is created fine.
Now I call the executeable from a bat-File:
M:\kunden\ISTA\Kaltmiete\customize>copyZipW32.exe -e cold -e pdf -d
"f:\temp me" "M:\kunden\ISTA\Kaltmiete\customize\Kopie von if1 (1).pdf"
"M:\kunden\ISTA\Kaltmiete\customize\Kopie von if1 (1).cold"
vor getopt
Parameter: -e at script/copyZip.pl line 35.
Parameter: cold at script/copyZip.pl line 35.
Parameter: -e at script/copyZip.pl line 35.
Parameter: pdf at script/copyZip.pl line 35.
Parameter: -d at script/copyZip.pl line 35.
Parameter: f:\temp at script/copyZip.pl line 35.
Parameter: me at script/copyZip.pl line 35.
Parameter: M:\kunden\ISTA\Kaltmiete\customize\Kopie at script/copyZip.pl
line 35.
Parameter: von at script/copyZip.pl line 35.
Parameter: if1 at script/copyZip.pl line 35.
Parameter: (1).pdf at script/copyZip.pl line 35.
Parameter: M:\kunden\ISTA\Kaltmiete\customize\Kopie at script/copyZip.pl
line 35.
Parameter: von at script/copyZip.pl line 35.
Parameter: if1 at script/copyZip.pl line 35.
Parameter: (1).cold at script/copyZip.pl line 35.
------------------
Parameter: me at script/copyZip.pl line 60.
Parameter: M:\kunden\ISTA\Kaltmiete\customize\Kopie at script/copyZip.pl
line 60.
Parameter: von at script/copyZip.pl line 60.
Parameter: if1 at script/copyZip.pl line 60.
Parameter: (1).pdf at script/copyZip.pl line 60.
Parameter: M:\kunden\ISTA\Kaltmiete\customize\Kopie at script/copyZip.pl
line 60.
Parameter: von at script/copyZip.pl line 60.
Parameter: if1 at script/copyZip.pl line 60.
Parameter: (1).cold at script/copyZip.pl line 60.

The command line parameters are now splitted at each blank character.
Is there a special syntax to overcome this problem?

best regards
Josef
Roderich Schupp via RT
2017-10-10 11:01:06 UTC
Permalink
Tue Oct 10 07:01:05 2017: Request 123232 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: PAR-Packer
Subject: commandline arguments under windows
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: ***@documatrix.com
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=123232 >
Post by Josef Gruber via RT
The command line parameters are now splitted at each blank character.
Which version of PAR::Packer are you using?
If it's NOT 1.039, please try that version.

Cheers, Roderich
Josef Gruber via RT
2017-10-10 12:02:58 UTC
Permalink
Tue Oct 10 08:02:57 2017: Request 123232 was acted upon.
Transaction: Correspondence added by ***@documatrix.com
Queue: PAR-Packer
Subject: Re: [rt.cpan.org #123232] commandline arguments under windows
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: ***@documatrix.com
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=123232 >


Hello Roderich,

I was using 1.037
cpan> upgrade PAR::Packer

Package namespace         installed    latest  in CPAN file
PAR::Packer                   1.037     1.039
RSCHUPP/PAR-Packer-1.039.tar.gz
Running install for module 'PAR::Packer'
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/R/RS/RSCHUPP/PAR-Packer-1.039.tar.gz
Checksum for
C:\STRAWB~1\cpan\sources\authors\id\R\RS\RSCHUPP\PAR-Packer-1.039.tar.gz ok
Scanning cache C:\STRAWB~1\cpan\build for sizes

The upgrade for 32Bit Windows works fine, the commandline arguments are
now forwarded in a correct way!



Trying to upgrade the W64 environment, I get a compiler error:
Package namespace         installed    latest  in CPAN file
PAR::Packer                   1.036     1.039
RSCHUPP/PAR-Packer-1.039.tar.gz
Running install for module 'PAR::Packer'
Checksum for
C:\STRAWB~1\cpan\sources\authors\id\R\RS\RSCHUPP\PAR-Packer-1.039.tar.gz ok
Scanning cache C:\STRAWB~1\cpan\build for sizes
......................................................................------DONE
DEL(1/2): C:\STRAWB~1\cpan\build\PAR-Packer-1.036-0
DEL(2/2): C:\STRAWB~1\cpan\build\PAR-Packer-1.036-0.yml
Configuring R/RS/RSCHUPP/PAR-Packer-1.039.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a dmake-style Makefile
Writing Makefile for PAR::Packer
Writing MYMETA.yml and MYMETA.json
  RSCHUPP/PAR-Packer-1.039.tar.gz
  C:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK
Running make for R/RS/RSCHUPP/PAR-Packer-1.039.tar.gz
cp lib/App/Packer/PAR.pm blib\lib\App\Packer\PAR.pm
cp lib/PAR/Filter/PodStrip.pm blib\lib\PAR\Filter\PodStrip.pm
cp lib/pp.pm blib\lib\pp.pm
cp lib/PAR/Packer.pm blib\lib\PAR\Packer.pm
cp lib/PAR/Filter/PatchContent.pm blib\lib\PAR\Filter\PatchContent.pm
cp lib/PAR/Filter/Bleach.pm blib\lib\PAR\Filter\Bleach.pm
cp lib/PAR/Filter/Obfuscate.pm blib\lib\PAR\Filter\Obfuscate.pm
cp lib/PAR/Filter/Bytecode.pm blib\lib\PAR\Filter\Bytecode.pm
cp lib/PAR/Filter.pm blib\lib\PAR\Filter.pm
cp lib/PAR/StrippedPARL/Base.pm blib\lib\PAR\StrippedPARL\Base.pm
"C:\Strawberry\perl\bin\perl.exe" par_pl2c.pl my_par_pl <
..\script\par.pl > my_par_pl.c
"C:\Strawberry\perl\bin\perl.exe" sha1.c.PL
gcc -c -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing
-mms-bitfields -I"
C:\STRAWB~1\perl\lib\CORE"  -DLDLIBPTHNAME=\"\" -DPARL_EXE=\"parl.exe\"
-DPAR_PACKER_VERSION=\"1.039\" -s -O2 main.c
windres -i winres/pp.rc -o ppresource.coff --input-format=rc
--output-format=coff --target=pe-x86-64
g++ main.o ppresource.coff -s   -s -L"C:\STRAWB~1\perl\lib\CORE"
-L"C:\STRAWB~1\c\lib"  "C:\STRAWB~1\perl\lib\CORE\libperl524.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32
\lib\libmoldname.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libkernel32.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser32.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32\lib\
libgdi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinspool.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomdlg32.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadv
api32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libole32.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32\lib\liboleaut32.a
" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libnetapi32.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuuid.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libws2_32.a" "C:\STR
AWB~1\c\x86_64-w64-mingw32\lib\libmpr.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinmm.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libversion.a" "C:\STRAWB~1\c\x86_
64-w64-mingw32\lib\libodbc32.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32.a"
"C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomctl32.a" -o par.exe
rem
"C:\Strawberry\perl\bin\perl.exe" encode_append.pl Dynamic.in par.exe
Dynamic.pm
"C:\Strawberry\perl\bin\perl.exe" embed_files.pl -c 32768 par.exe
"C:\STRAWB~1\perl\bin\perl524.dll"
"C:\Strawberry\perl\bin\libgcc_s_sjlj-1.dll" "C:\Strawberry\p
erl\bin\libwinpthread-1.dll" "C:\Strawberry\perl\bin\libstdc++-6.dll" >
boot_embedded_files.c
# using "objdump" recusrively to find DLLs needed by par.exe
# embedding "par.exe" as "par.exe"
# embedding "C:\Strawberry\perl\bin/perl524.dll" as "perl524.dll"
# embedding "C:\Strawberry\perl\bin/libgcc_s_sjlj-1.dll" as
"libgcc_s_sjlj-1.dll"
# embedding "C:\Strawberry\perl\bin/libwinpthread-1.dll" as
"libwinpthread-1.dll"
# embedding "C:\Strawberry\perl\bin/libstdc++-6.dll" as "libstdc++-6.dll"
gcc -c -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing
-mms-bitfields -I"
C:\STRAWB~1\perl\lib\CORE"  -DLDLIBPTHNAME=\"\" -DPARL_EXE=\"parl.exe\"
-DPAR_PACKER_VERSION=\"1.039\" -s -O2 boot.c
In file included from mktmpdir.h:87:0,
                 from mktmpdir.c:1,
                 from boot.c:10:
sha1.c: In function 'sha_transform':
sha1.c:146:2: warning: right shift count >= width of type
  T >>= 32;
  ^
boot.c: In function 'shell_quote':
boot.c:123:15: warning: initialization discards 'const' qualifier from
pointer target type
     char *p = src;
               ^
boot.c: In function 'main':
boot.c:264:5: error: 'for' loop initial declarations are only allowed in
C99 or C11 mode
     for (char **argp = argv; *argp; argp++)
     ^
boot.c:264:5: note: use option -std=c99, -std=gnu99, -std=c11 or
-std=gnu11 to compile your code
dmake:  Error code 129, while making 'boot.o'
dmake.exe:  Error code 255, while making 'subdirs'
  RSCHUPP/PAR-Packer-1.039.tar.gz
  C:\STRAWB~1\c\bin\dmake.exe -- NOT OK
Stopping: 'install' failed for 'PAR::Packer'.
Failed during this command:
 RSCHUPP/PAR-Packer-1.039.tar.gz              : make NO

cpan>



setting a CFLAGS environmentvariable doesn'r help:
C:\Users\jg1001>set CFLAGS=-std=c99

C:\Users\jg1001>echo %CFLAGS
%CFLAGS

C:\Users\jg1001>echo %CFLAGS%
-std=c99

C:\Users\jg1001>

best regards
Josef
Post by Josef Gruber via RT
<URL: https://rt.cpan.org/Ticket/Display.html?id=123232 >
Post by Josef Gruber via RT
The command line parameters are now splitted at each blank character.
Which version of PAR::Packer are you using?
If it's NOT 1.039, please try that version.
Cheers, Roderich
Roderich Schupp via RT
2017-10-10 14:37:24 UTC
Permalink
Tue Oct 10 10:37:23 2017: Request 123232 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: PAR-Packer
Subject: commandline arguments under windows
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: ***@documatrix.com
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=123232 >
...
Post by Josef Gruber via RT
boot.c:123:15: warning: initialization discards 'const' qualifier
from
pointer target type
     char *p = src;
               ^
boot.c:264:5: error: 'for' loop initial declarations are only allowed
in
C99 or C11 mode
     for (char **argp = argv; *argp; argp++)
     ^
boot.c:264:5: note: use option -std=c99, -std=gnu99, -std=c11 or
-std=gnu11 to compile your code
dmake:  Error code 129, while making 'boot.o'
Known problem, already fixed in GitHub repo.
Wait for the next release or apply the following patch

https://github.com/rschupp/PAR-Packer/commit/635a2dac2bc56d5e388d4ec831c2a92fd32f46ef

Cheers, Roderich

Loading...