LoginSignup
0

More than 1 year has passed since last update.

Perlスクリプトファイルをexe化したい

Last updated at Posted at 2021-08-29

概要

タイトルの通りです。
Strawberry Perlでcpanとかを使ってexeファイル化できると聞いて試してみました。

PAR::Packerのインストールでmakeエラーが出たので直接gmakeしました。

環境

  • Windows 10 Home
  • 64 ビット オペレーティング システム
  • 20H2
  • OSビルド:19042.1165
  • perl v5.32.1 built for MSWin32-x64-multi-thread
  • C:\Strawberry\perl\bin/cpan script version 1.676, CPAN.pm version 2.28

インストール

cpan> install PAR::Packer
Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz
Fetching with LWP:
http://cpan.strawberryperl.com/modules/02packages.details.txt.gz
Fetching with LWP:
http://cpan.strawberryperl.com/modules/03modlist.data.gz
Creating database file ... Done!
Running install for module 'PAR::Packer'
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/R/RS/RSCHUPP/PAR-Packer-1.052.tar.gz
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/R/RS/RSCHUPP/CHECKSUMS
Checksum for C:\STRAWB~1\cpan\sources\authors\id\R\RS\RSCHUPP\PAR-Packer-1.052.tar.gz ok
Scanning cache C:\STRAWB~1\cpan\build for sizes
DONE
Configuring R/RS/RSCHUPP/PAR-Packer-1.052.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite Getopt::ArgvFile 1.07 not found.
Warning: prerequisite Module::ScanDeps 1.21 not found.
Subroutine MY::postamble redefined at ./Makefile.PL line 230.
# using "objdump" recursively to find DLLs needed by par.exe
Generating a gmake-style Makefile
Writing Makefile for PAR::Packer
Writing MYMETA.yml and MYMETA.json
  RSCHUPP/PAR-Packer-1.052.tar.gz
  C:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK
Running make for R/RS/RSCHUPP/PAR-Packer-1.052.tar.gz
---- Unsatisfied dependencies detected during ----
----      RSCHUPP/PAR-Packer-1.052.tar.gz     ----
    Getopt::ArgvFile [requires]
    Module::ScanDeps [requires]
    Module::Signature [requires,optional]
    Tk [requires,optional]
    Tk::ColoredButton [requires,optional]
    Tk::EntryCheck [requires,optional]
    Tk::Getopt [requires,optional]
Running install for module 'Getopt::ArgvFile'
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/J/JS/JSTENZEL/Getopt-ArgvFile-1.11.tar.gz
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/J/JS/JSTENZEL/CHECKSUMS
Checksum for C:\STRAWB~1\cpan\sources\authors\id\J\JS\JSTENZEL\Getopt-ArgvFile-1.11.tar.gz ok
Configuring J/JS/JSTENZEL/Getopt-ArgvFile-1.11.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a gmake-style Makefile
Writing Makefile for Getopt::ArgvFile
Writing MYMETA.yml and MYMETA.json
  JSTENZEL/Getopt-ArgvFile-1.11.tar.gz
  C:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK
Running make for J/JS/JSTENZEL/Getopt-ArgvFile-1.11.tar.gz
cp ArgvFile.pm blib\lib\Getopt\ArgvFile.pm
  JSTENZEL/Getopt-ArgvFile-1.11.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe -- OK
Running make test for JSTENZEL/Getopt-ArgvFile-1.11.tar.gz
"C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/base.t ........... ok
t/expandenv.t ...... ok
t/fileopt.t ........ ok
t/noHOMEvar.t ...... ok
t/pod-coverage.t ... ok
t/pod.t ............ ok
t/prefix.t ......... ok
t/resolvepathes.t .. ok
t/use1.t ........... ok
t/use2.t ........... ok
All tests successful.
Files=10, Tests=45,  2 wallclock secs ( 0.01 usr +  0.03 sys =  0.05 CPU)
Result: PASS
Lockfile removed.
  JSTENZEL/Getopt-ArgvFile-1.11.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe test -- OK
Running make install for JSTENZEL/Getopt-ArgvFile-1.11.tar.gz
Installing C:\STRAWB~1\perl\site\lib\Getopt\ArgvFile.pm
Appending installation info to C:\STRAWB~1\perl\lib/perllocal.pod
  JSTENZEL/Getopt-ArgvFile-1.11.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe install UNINST=1 -- OK
Running install for module 'Module::ScanDeps'
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/R/RS/RSCHUPP/Module-ScanDeps-1.31.tar.gz
Checksum for C:\STRAWB~1\cpan\sources\authors\id\R\RS\RSCHUPP\Module-ScanDeps-1.31.tar.gz ok
Configuring R/RS/RSCHUPP/Module-ScanDeps-1.31.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a gmake-style Makefile
Writing Makefile for Module::ScanDeps
Writing MYMETA.yml and MYMETA.json
  RSCHUPP/Module-ScanDeps-1.31.tar.gz
  C:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK
Running make for R/RS/RSCHUPP/Module-ScanDeps-1.31.tar.gz
cp lib/Module/ScanDeps.pm blib\lib\Module\ScanDeps.pm
cp lib/Module/ScanDeps/Cache.pm blib\lib\Module\ScanDeps\Cache.pm
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- script/scandeps.pl blib\script\scandeps.pl
pl2bat.bat blib\script\scandeps.pl
  RSCHUPP/Module-ScanDeps-1.31.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe -- OK
Running make test for RSCHUPP/Module-ScanDeps-1.31.tar.gz
"C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/0-pod.t ....................................... ok
t/1-static_functional_interface_real.t .......... ok
t/10-case-insensitive-keys.t .................... ok
t/12-ScanFileRE.t ............................... ok
t/13-static_prefork_test.t ...................... skipped: Test requires module 'prefork' but it's not found
t/14-scan_chunk.t ............................... ok
t/14-static_functional_cached.t ................. 1/? 0
Couldn't retrieve data from file deps_cache.dat. Building new cache.
t/14-static_functional_cached.t ................. ok
t/16-scan_line.t ................................ ok
t/17-private_methods.t .......................... ok
t/18-findbin.t .................................. ok
t/2-static_functional_interface_fake.t .......... ok
t/3-static_oo_interface_real.t .................. ok
t/4-static_functional_interface_options_fake.t .. ok
t/5-pluggable_fake.t ............................ ok
t/6-file-glob.t ................................. ok
t/7-check-dynaloader.t .......................... # dynamic modules used for test: File::Glob Data::Dumper List::Util Time::HiRes Compress::Raw::Zlib
# check_bundle_path:static for File::Glob ...
t/7-check-dynaloader.t .......................... 1/40 C:\Users\shiro\AppData\Local\Temp\CCN2pOndRW syntax OK
# check_bundle_path:compile for File::Glob ...
# check_bundle_path:execute for File::Glob ...
# check_bundle_path:execute_with_args for File::Glob ...
# check_bundle_path:static for Data::Dumper ...
C:\Users\shiro\AppData\Local\Temp\pD6Zx9NtBE syntax OK
# check_bundle_path:compile for Data::Dumper ...
# check_bundle_path:execute for Data::Dumper ...
# check_bundle_path:execute_with_args for Data::Dumper ...
# check_bundle_path:static for List::Util ...
C:\Users\shiro\AppData\Local\Temp\JMXi_vmofG syntax OK
# check_bundle_path:compile for List::Util ...
# check_bundle_path:execute for List::Util ...
# check_bundle_path:execute_with_args for List::Util ...
# check_bundle_path:static for Time::HiRes ...
t/7-check-dynaloader.t .......................... 25/40 C:\Users\shiro\AppData\Local\Temp\5DOcK9Pf0X syntax OK
# check_bundle_path:compile for Time::HiRes ...
# check_bundle_path:execute for Time::HiRes ...
# check_bundle_path:execute_with_args for Time::HiRes ...
# check_bundle_path:static for Compress::Raw::Zlib ...
C:\Users\shiro\AppData\Local\Temp\ekKyJI8Fu_ syntax OK
# check_bundle_path:compile for Compress::Raw::Zlib ...
# check_bundle_path:execute for Compress::Raw::Zlib ...
# check_bundle_path:execute_with_args for Compress::Raw::Zlib ...
t/7-check-dynaloader.t .......................... ok
t/8-check_duplicated_entries.t .................. ok
t/9-check_path_to_inc_name.t .................... ok
t/rt90869.t ..................................... ok
All tests successful.
Files=19, Tests=5004, 11 wallclock secs ( 0.19 usr +  0.03 sys =  0.22 CPU)
Result: PASS
Lockfile removed.
  RSCHUPP/Module-ScanDeps-1.31.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe test -- OK
Running make install for RSCHUPP/Module-ScanDeps-1.31.tar.gz
Installing C:\STRAWB~1\perl\site\lib\Module\ScanDeps.pm
Installing C:\STRAWB~1\perl\site\lib\Module\ScanDeps\Cache.pm
Installing C:\STRAWB~1\perl\site\bin\scandeps.bat
Installing C:\STRAWB~1\perl\site\bin\scandeps.pl
Appending installation info to C:\STRAWB~1\perl\lib/perllocal.pod
  RSCHUPP/Module-ScanDeps-1.31.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe install UNINST=1 -- OK
  RSCHUPP/PAR-Packer-1.052.tar.gz
  Has already been unwrapped into directory C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0
  RSCHUPP/PAR-Packer-1.052.tar.gz
  Has already been prepared
Running make for R/RS/RSCHUPP/PAR-Packer-1.052.tar.gz
---- Unsatisfied dependencies detected during ----
----      RSCHUPP/PAR-Packer-1.052.tar.gz     ----
    Module::Signature [requires,optional]
    Tk [requires,optional]
    Tk::ColoredButton [requires,optional]
    Tk::EntryCheck [requires,optional]
    Tk::Getopt [requires,optional]
cp lib/PAR/Filter/Bleach.pm blib\lib\PAR\Filter\Bleach.pm
cp lib/PAR/Filter.pm blib\lib\PAR\Filter.pm
cp lib/App/Packer/PAR.pm blib\lib\App\Packer\PAR.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/Obfuscate.pm blib\lib\PAR\Filter\Obfuscate.pm
cp lib/PAR/Filter/Bytecode.pm blib\lib\PAR\Filter\Bytecode.pm
cp lib/pp.pm blib\lib\pp.pm
cp lib/PAR/Filter/PodStrip.pm blib\lib\PAR\Filter\PodStrip.pm
cp lib/PAR/StrippedPARL/Base.pm blib\lib\PAR\StrippedPARL\Base.pm
gmake[1]: Entering directory 'C:/STRAWB~1/cpan/build/PAR-Packer-1.052-0/myldr'
Makefile:868: warning: overriding recipe for target '.c.o'
Makefile:340: warning: ignoring old recipe for target '.c.o'
"C:\Strawberry\perl\bin\perl.exe" par_pl2c.pl my_par_pl < ..\script\par.pl > my_par_pl.c
gcc -c -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields  -I"C:\STRAWB~1\perl\lib\CORE"  -DLDLIBPTHNAME=\"\" -DPARL_EXE=\"parl.exe\" -DPAR_PACKER_VERSION=\"1.052\" -s -O2 main.c
gcc -c -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields  -I"C:\STRAWB~1\perl\lib\CORE"  -DLDLIBPTHNAME=\"\" -DPARL_EXE=\"parl.exe\" -DPAR_PACKER_VERSION=\"1.052\" -s -O2 -DBYTEORDER=0x12345678 -DU64TYPE="unsigned long long" sha1.c
windres -i winres/pp.rc -o ppresource.coff --input-format=rc --output-format=coff --target=pe-x86-64
g++ main.o sha1.o ppresource.coff -s   -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib"  "C:\STRAWB~1\perl\lib\CORE\libperl532.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\libadvapi32.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:\STRAWB~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 recursive_objdump "C:\STRAWB~1\perl\bin\perl532.dll" > boot_embedded_files.c
# using method recursive_objdump to find files to embed
# embedding "par.exe" as "par.exe"
# embedding "C:\Strawberry\perl\bin/libwinpthread-1.dll" as "libwinpthread-1.dll"
# embedding "C:\Strawberry\perl\bin/perl532.dll" as "perl532.dll"
# embedding "C:\Strawberry\perl\bin/libstdc++-6.dll" as "libstdc++-6.dll"
# embedding "C:\Strawberry\perl\bin/libgcc_s_seh-1.dll" as "libgcc_s_seh-1.dll"
gcc -c -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields  -I"C:\STRAWB~1\perl\lib\CORE"  -DLDLIBPTHNAME=\"\" -DPARL_EXE=\"parl.exe\" -DPAR_PACKER_VERSION=\"1.052\" -s -O2 boot.c
g++ boot.o sha1.o  -static-libgcc -s   -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib"  "C:\STRAWB~1\perl\lib\CORE\libperl532.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\libadvapi32.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:\STRAWB~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"  ppresource.coff -o boot.exe
rem
"C:\Strawberry\perl\bin\perl.exe" encode_append.pl Static.in boot.exe Static.pm
"C:\Strawberry\perl\bin\perl.exe" -Mblib=.. run_with_inc.pl boot.exe -q -B -Oparl.exe
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- parl.exe ..\blib\script\parl.exe
rem ..\blib\script\parl.exe
"C:\Strawberry\perl\bin\perl.exe" -Mblib=.. run_with_inc.pl par.exe -q -B -Oparldyn.exe
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- parldyn.exe ..\blib\script\parldyn.exe
rem ..\blib\script\parldyn.exe
gmake[1]: Leaving directory 'C:/STRAWB~1/cpan/build/PAR-Packer-1.052-0/myldr'
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- script/par.pl blib\script\par.pl
pl2bat.bat blib\script\par.pl
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- script/pp blib\script\pp
pl2bat.bat blib\script\pp
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- script/tkpp blib\script\tkpp
pl2bat.bat blib\script\tkpp
  RSCHUPP/PAR-Packer-1.052.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe -- OK
Running make test for RSCHUPP/PAR-Packer-1.052.tar.gz
gmake[1]: Entering directory 'C:/STRAWB~1/cpan/build/PAR-Packer-1.052-0/myldr'
Makefile:868: warning: overriding recipe for target '.c.o'
Makefile:340: warning: ignoring old recipe for target '.c.o'
gmake[1]: Leaving directory 'C:/STRAWB~1/cpan/build/PAR-Packer-1.052-0/myldr'
gmake[1]: Entering directory 'C:/STRAWB~1/cpan/build/PAR-Packer-1.052-0/myldr'
Makefile:868: warning: overriding recipe for target '.c.o'
Makefile:340: warning: ignoring old recipe for target '.c.o'
No tests defined for myldr extension.
gmake[1]: Leaving directory 'C:/STRAWB~1/cpan/build/PAR-Packer-1.052-0/myldr'
"C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/00-pod.t ............... skipped: Set environment variable PERL_TEST_POD=1 to test POD
t/10-parl-generation.t ... ok
t/20-pp.t ................ 13/34 C:\Users\shiro\AppData\Local\Temp\bLdbcymQMh syntax OK
t/20-pp.t ................ 25/34
#   Failed test 'pp_minus_r_hello_a_b_c
# [430]
# Test 25_0 The command string ""c:\strawb~1\perl\bin\perl.exe" "C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\blib\script\pp" -r "hello.pl" "one" "two" "three"  " in directory C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\contrib\automated_pp_test\pp_switch_tests\temp1,did not produce :: "hello one two three" ::
# Instead, it produced :: 指定されたプログラムは実行できません。
# 'a.exe' は、内部コマンドまたは外部コマンド、
# 操作可能なプログラムまたはバッチ ファイルとして認識されていません。 ::
# End of [430] results
#
# Did "c:\strawb~1\perl\bin\perl.exe" "C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\blib\script\pp" -r "hello.pl" "one" "two" "three" produce a.exe?
# '
#   at ./automated_pp_test.pl line 7956.
指定されたプログラムは実行できません。
t/20-pp.t ................ 26/34
#   Failed test 'pp_hello_to_log_file
# [430]
# Test 26_0 The command string " a.exe " in directory C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\contrib\automated_pp_test\pp_switch_tests\temp2,did not produce :: "hello" ::
# Instead, it produced :: 'a.exe' は、内部コマンドまたは外部コマンド、
# 操作可能なプログラムまたはバッチ ファイルとして認識されていません。 ::
# End of [430] results
#
# Did "c:\strawb~1\perl\bin\perl.exe" "C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\blib\script\pp" hello.pl -v --log=c.txt produce a.exe?
# '
#   at ./automated_pp_test.pl line 8001.
指定されたプログラムは実行できません。
t/20-pp.t ................ 27/34
#   Failed test 'pp_name_four_ways
# amsg326: sub pp_name_four_ways:
# [430]
# Test 27_0 The command string " a.exe " in directory C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\contrib\automated_pp_test\pp_switch_tests\temp0,did not produce :: "hello" ::
# Instead, it produced :: 'a.exe' は、内部コマンドまたは外部コマンド、
# 操作可能なプログラムまたはバッチ ファイルとして認識されていません。 ::
# End of [430] results
# '
#   at ./automated_pp_test.pl line 8046.
指定されたプログラムは実行できません。
t/20-pp.t ................ 28/34
#   Failed test 'pp_minus_v_tests  Test 28_0
#
# [430]
# Test 28_0 The command string " a.exe " in directory C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\contrib\automated_pp_test\pp_switch_tests\temp1,did not produce :: "hello" ::
# Instead, it produced :: 'a.exe' は、内部コマンドまたは外部コマンド、
# 操作可能なプログラムまたはバッチ ファイルとして認識されていません。 ::
# End of [430] results
#
# Did "c:\strawb~1\perl\bin\perl.exe" "C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\blib\script\pp" -v 1 hello.pl > v_1.txt produce a.exe?
# '
#   at ./automated_pp_test.pl line 8092.
t/20-pp.t ................ 30/34 指定されたプログラムは実行できません。
指定されたプログラムは実行できません。
指定されたプログラムは実行できません。
指定されたプログラムは実行できません。
t/20-pp.t ................ 31/34 指定されたプログラムは実行できません。
C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\blib\script\pp: Cannot open hello.exe for reading: No such file or directory at C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\blib\lib/PAR/Packer.pm line 1217, <DATA> line 1.
t/20-pp.t ................ 32/34
#   Failed test 'pp_gui_tests
# amsg572: sub pp_gui_tests cannot system "c:\strawb~1\perl\bin\perl.exe" "C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\blib\script\pp" --gui -o hello.exe hello.pl:Inappropriate I/O control operation:
# '
#   at ./automated_pp_test.pl line 8269.
指定されたプログラムは実行できません。
t/20-pp.t ................ 33/34
#   Failed test 'pp_test_small_minus_a
# [300]sub pp_test_small_minus_a: cannot copy hello.exe to C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\contrib\automated_pp_test\pp_switch_tests\temp0/subdir1
#
# Did "c:\strawb~1\perl\bin\perl.exe" "C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\blib\script\pp" -o hello.exe -a "C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\contrib\automated_pp_test\pp_switch_tests\temp0\text" hello.pl produce hello.exe?
# '
#   at ./automated_pp_test.pl line 8314.
指定されたプログラムは実行できません。
t/20-pp.t ................ 34/34
#   Failed test 'pp_test_large_minus_A
# [430]
# Test 34_0 The command string " hello.exe " in directory C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\contrib\automated_pp_test\pp_switch_tests\temp1,did not produce :: "hello01hello02" ::
# Instead, it produced :: 'hello.exe' は、内部コマンドまたは外部コマンド、
# 操作可能なプログラムまたはバッチ ファイルとして認識されていません。 ::
# End of [430] results
#
# Did "c:\strawb~1\perl\bin\perl.exe" "C:\STRAWB~1\cpan\build\PAR-Packer-1.052-0\blib\script\pp" -o hello.exe -A all_text_files  -a all_text_files  hello.pl produce hello.exe?
# '
#   at ./automated_pp_test.pl line 8359.
# Looks like you failed 7 tests of 34.
t/20-pp.t ................ Dubious, test returned 7 (wstat 1792, 0x700)
Failed 7/34 subtests
t/30-current_exec.t ...... # Please wait
t/30-current_exec.t ...... ok
t/40-packer_cd_option.t .. ok
t/80-doublecolon.t ....... ok
t/85-crt-glob.t .......... ok
t/85-myfile.t ............ ok
t/90-rt101800.t .......... 2/18 # PAR_TEMP = C:\Users\shiro\AppData\Local\Temp\28HuSOq0Do\par-736869726f\cache-a3887bbc2b178afc752d972687361580c00a985c
# running C:\Users\shiro\AppData\Local\Temp\28HuSOq0Do\packed.exe a second time
t/90-rt101800.t .......... 12/18 # running C:\Users\shiro\AppData\Local\Temp\28HuSOq0Do\packed.exe a third time
t/90-rt101800.t .......... ok
t/90-rt103861.t .......... ok
t/90-rt104560.t .......... ok
t/90-rt104635.t .......... ok
t/90-rt122949.t .......... ok
t/90-rt127064.t .......... 1/3 # running C:\Users\shiro\AppData\Local\Temp\iN2OMSofVs\packed.exe with PAR_TMPDIR=C:\Users\shiro\AppData\Local\Temp\iN2OMSofVs\t m p ...
t/90-rt127064.t .......... ok
t/90-rt129312.t .......... ok
t/90-rt130685.t .......... # found core module Carp in C:/Strawberry/perl/lib/Carp.pm
t/90-rt130685.t .......... 1/8 # found core module Exporter in C:/Strawberry/perl/lib/Exporter.pm
# found core module File::Glob in C:/Strawberry/perl/lib/File/Glob.pm
# found core module List::Util in C:/Strawberry/perl/lib/List/Util.pm
t/90-rt130685.t .......... ok
t/90-rt59710.t ........... ok

Test Summary Report
-------------------
t/20-pp.t              (Wstat: 1792 Tests: 34 Failed: 7)
  Failed tests:  25-28, 32-34
  Non-zero exit status: 7
Files=17, Tests=243, 214 wallclock secs ( 0.09 usr +  0.06 sys =  0.16 CPU)
Result: FAIL
Failed 1/17 test programs. 7/243 subtests failed.
gmake: *** [Makefile:1031: test_dynamic] Error 255
Lockfile removed.
  RSCHUPP/PAR-Packer-1.052.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports RSCHUPP/PAR-Packer-1.052.tar.gz
Stopping: 'install' failed for 'R/RS/RSCHUPP/PAR-Packer-1.052.tar.gz'.
Failed during this command:
 RSCHUPP/PAR-Packer-1.052.tar.gz              : make_test NO

エラーメッセージが出たので参考サイトを見て直接makeしてみました。

C:\Strawberry\cpan\build\PAR-Packer-1.052-0>gmake
Skip blib\lib\PAR\Filter\Obfuscate.pm (unchanged)
Skip blib\lib\PAR\Filter\Bleach.pm (unchanged)
Skip blib\lib\pp.pm (unchanged)
Skip blib\lib\PAR\Filter\Bytecode.pm (unchanged)
Skip blib\lib\PAR\StrippedPARL\Base.pm (unchanged)
Skip blib\lib\App\Packer\PAR.pm (unchanged)
Skip blib\lib\PAR\Filter\PatchContent.pm (unchanged)
Skip blib\lib\PAR\Packer.pm (unchanged)
Skip blib\lib\PAR\Filter\PodStrip.pm (unchanged)
Skip blib\lib\PAR\Filter.pm (unchanged)
gmake[1]: Entering directory 'C:/Strawberry/cpan/build/PAR-Packer-1.052-0/myldr'
Makefile:872: warning: overriding recipe for target '.c.o'
Makefile:344: warning: ignoring old recipe for target '.c.o'
gcc -c -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields  -I"C:\STRAWB~1\perl\lib\CORE"  -DLDLIBPTHNAME=\"\" -DPARL_EXE=\"parl.exe\" -DPAR_PACKER_VERSION=\"1.052\" -s -O2 main.c
gcc -c -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields  -I"C:\STRAWB~1\perl\lib\CORE"  -DLDLIBPTHNAME=\"\" -DPARL_EXE=\"parl.exe\" -DPAR_PACKER_VERSION=\"1.052\" -s -O2 -DBYTEORDER=0x12345678 -DU64TYPE="unsigned long long" sha1.c
g++ main.o sha1.o ppresource.coff -s   -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib"  "C:\STRAWB~1\perl\lib\CORE\libperl532.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\libadvapi32.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:\STRAWB~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 recursive_objdump "C:\STRAWB~1\perl\bin\perl532.dll" > boot_embedded_files.c
# using method recursive_objdump to find files to embed
# embedding "par.exe" as "par.exe"
# embedding "C:\Strawberry\perl\bin/libwinpthread-1.dll" as "libwinpthread-1.dll"
# embedding "C:\Strawberry\perl\bin/libstdc++-6.dll" as "libstdc++-6.dll"
# embedding "C:\Strawberry\perl\bin/perl532.dll" as "perl532.dll"
# embedding "C:\Strawberry\perl\bin/libgcc_s_seh-1.dll" as "libgcc_s_seh-1.dll"
gcc -c -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields  -I"C:\STRAWB~1\perl\lib\CORE"  -DLDLIBPTHNAME=\"\" -DPARL_EXE=\"parl.exe\" -DPAR_PACKER_VERSION=\"1.052\" -s -O2 boot.c
g++ boot.o sha1.o  -static-libgcc -s   -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib"  "C:\STRAWB~1\perl\lib\CORE\libperl532.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\libadvapi32.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:\STRAWB~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"  ppresource.coff -o boot.exe
rem
"C:\Strawberry\perl\bin\perl.exe" encode_append.pl Static.in boot.exe Static.pm
"C:\Strawberry\perl\bin\perl.exe" -Mblib=.. run_with_inc.pl boot.exe -q -B -Oparl.exe
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- parl.exe ..\blib\script\parl.exe
rem ..\blib\script\parl.exe
"C:\Strawberry\perl\bin\perl.exe" -Mblib=.. run_with_inc.pl par.exe -q -B -Oparldyn.exe
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- parldyn.exe ..\blib\script\parldyn.exe
rem ..\blib\script\parldyn.exe
gmake[1]: Leaving directory 'C:/Strawberry/cpan/build/PAR-Packer-1.052-0/myldr'
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- script/par.pl blib\script\par.pl
pl2bat.bat blib\script\par.pl
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- script/pp blib\script\pp
pl2bat.bat blib\script\pp
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- script/tkpp blib\script\tkpp
pl2bat.bat blib\script\tkpp

C:\Strawberry\cpan\build\PAR-Packer-1.052-0>
C:\Strawberry\cpan\build\PAR-Packer-1.052-0>gmake test
gmake[1]: Entering directory 'C:/Strawberry/cpan/build/PAR-Packer-1.052-0/myldr'
Makefile:872: warning: overriding recipe for target '.c.o'
Makefile:344: warning: ignoring old recipe for target '.c.o'
gmake[1]: Leaving directory 'C:/Strawberry/cpan/build/PAR-Packer-1.052-0/myldr'
gmake[1]: Entering directory 'C:/Strawberry/cpan/build/PAR-Packer-1.052-0/myldr'
Makefile:872: warning: overriding recipe for target '.c.o'
Makefile:344: warning: ignoring old recipe for target '.c.o'
No tests defined for myldr extension.
gmake[1]: Leaving directory 'C:/Strawberry/cpan/build/PAR-Packer-1.052-0/myldr'
"C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/00-pod.t ............... skipped: Set environment variable PERL_TEST_POD=1 to test POD
t/10-parl-generation.t ... ok
t/20-pp.t ................ 12/34 C:\Users\shiro\AppData\Local\Temp\s_ZdtLgr9u syntax OK
t/20-pp.t ................ ok
t/30-current_exec.t ...... # Please wait
t/30-current_exec.t ...... ok
t/40-packer_cd_option.t .. 1/2 Can't create file "a.exe": Permission denied at -e line 240.
t/40-packer_cd_option.t .. ok
t/80-doublecolon.t ....... ok
t/85-crt-glob.t .......... ok
t/85-myfile.t ............ ok
t/90-rt101800.t .......... 2/18 # PAR_TEMP = C:\Users\shiro\AppData\Local\Temp\AfLcBcekxI\par-736869726f\cache-9b3e29ad03c6ee7a315e2653a54ef31a588fc5bd
# running C:\Users\shiro\AppData\Local\Temp\AfLcBcekxI\packed.exe a second time
t/90-rt101800.t .......... 12/18 # running C:\Users\shiro\AppData\Local\Temp\AfLcBcekxI\packed.exe a third time
t/90-rt101800.t .......... ok
t/90-rt103861.t .......... ok
t/90-rt104560.t .......... ok
t/90-rt104635.t .......... ok
t/90-rt122949.t .......... ok
t/90-rt127064.t .......... 1/3 # running C:\Users\shiro\AppData\Local\Temp\Zl6ab3_Shc\packed.exe with PAR_TMPDIR=C:\Users\shiro\AppData\Local\Temp\Zl6ab3_Shc\t m p ...
t/90-rt127064.t .......... ok
t/90-rt129312.t .......... ok
t/90-rt130685.t .......... # found core module Carp in C:/Strawberry/perl/lib/Carp.pm
t/90-rt130685.t .......... 1/8 # found core module Exporter in C:/Strawberry/perl/lib/Exporter.pm
# found core module File::Glob in C:/Strawberry/perl/lib/File/Glob.pm
# found core module List::Util in C:/Strawberry/perl/lib/List/Util.pm
t/90-rt130685.t .......... ok
t/90-rt59710.t ........... ok
All tests successful.
Files=17, Tests=243, 257 wallclock secs ( 0.05 usr +  0.02 sys =  0.06 CPU)
Result: PASS

C:\Strawberry\cpan\build\PAR-Packer-1.052-0>gmake install
gmake[1]: Entering directory 'C:/Strawberry/cpan/build/PAR-Packer-1.052-0/myldr'
Makefile:872: warning: overriding recipe for target '.c.o'
Makefile:344: warning: ignoring old recipe for target '.c.o'
gmake[1]: Leaving directory 'C:/Strawberry/cpan/build/PAR-Packer-1.052-0/myldr'
Installing C:\STRAWB~1\perl\site\lib\pp.pm
Installing C:\STRAWB~1\perl\site\lib\App\Packer\PAR.pm
Installing C:\STRAWB~1\perl\site\lib\PAR\Filter.pm
Installing C:\STRAWB~1\perl\site\lib\PAR\Packer.pm
Installing C:\STRAWB~1\perl\site\lib\PAR\Filter\Bleach.pm
Installing C:\STRAWB~1\perl\site\lib\PAR\Filter\Bytecode.pm
Installing C:\STRAWB~1\perl\site\lib\PAR\Filter\Obfuscate.pm
Installing C:\STRAWB~1\perl\site\lib\PAR\Filter\PatchContent.pm
Installing C:\STRAWB~1\perl\site\lib\PAR\Filter\PodStrip.pm
Installing C:\STRAWB~1\perl\site\lib\PAR\StrippedPARL\Base.pm
Installing C:\STRAWB~1\perl\site\lib\PAR\StrippedPARL\Dynamic.pm
Installing C:\STRAWB~1\perl\site\lib\PAR\StrippedPARL\Static.pm
Installing C:\STRAWB~1\perl\site\bin\par.bat
Installing C:\STRAWB~1\perl\site\bin\par.pl
Installing C:\STRAWB~1\perl\site\bin\parl.exe
Installing C:\STRAWB~1\perl\site\bin\parldyn.exe
Installing C:\STRAWB~1\perl\site\bin\pp
Installing C:\STRAWB~1\perl\site\bin\pp.bat
Installing C:\STRAWB~1\perl\site\bin\tkpp
Installing C:\STRAWB~1\perl\site\bin\tkpp.bat
Appending installation info to C:\STRAWB~1\perl\lib/perllocal.pod

exeファイル作成テスト

うまくインストールされたようなので、試しにexeファイル化してみます。

#!usr/bin/env perl
open(OUT, ">test.txt");
print(OUT "Hello world!");
close(OUT);
D:\program\perl>pp -o test.exe test.pl

1630202635514.png

1630202689000.png

余談

本当は会社のプロキシ経由でインストールしたいのですが、あまりにうまく行かず一度自宅で試した結果でした。
こっちはうまくいってよかったです。

参考サイト

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0