perl-toolchain-gang / extutils-pl2bat Goto Github PK
View Code? Open in Web Editor NEWBatch file creation to run perl scripts on Windows
Batch file creation to run perl scripts on Windows
On unix-like platforms, EU::MM and M::B replace shebangs in scripts they install with the absolute path to the current perl interpreter. That ensures that the script will be always executed by the same perl installation.
Batch files generated by pl2bat are always using perl from %PATH%
which results in behaviour which is counter-intuitive and inconsistent with unix-like platforms. The fact that %PATH%
always contains implicit .
makes it even worse.
I think that scripts produced by pl2bat should use hardcoded, absolute path to the perl interpreter.
Example here. Output:
"C:\hostedtoolcache\windows\perl\5.26.3-thr\x64\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/00-compile.t ....... ok
# Failed test 'qx/"test_perl_source.bat" 0/ returns expected 0 (0)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '0'
# Failed test '"test_perl_source.bat": `exit 0` set expected ERRORLEVEL (0)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '0'
# Failed test '`"test_perl_source.bat" 0` process exit (PROCESS_FAILURE) is correct'
##[error]# at t/make_executable.t line 65.
# got: 'PROCESS_FAILURE'
# expected: 'PROCESS_SUCCESS'
# Failed test 'qx/"test_perl_source.bat" 1/ returns expected 0 (1)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '1'
# Failed test '"test_perl_source.bat": `exit 1` set expected ERRORLEVEL (1)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '1'
# Failed test 'qx/"test_perl_source.bat" 2/ returns expected 0 (2)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '2'
# Failed test '"test_perl_source.bat": `exit 2` set expected ERRORLEVEL (2)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '2'
# Failed test 'qx/"test_perl_source.bat" 3/ returns expected 0 (3)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '3'
# Failed test '"test_perl_source.bat": `exit 3` set expected ERRORLEVEL (3)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '3'
# Failed test 'qx/"test_perl_source.bat" -1/ returns expected 0 (255)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '255'
# Failed test '"test_perl_source.bat": `exit -1` set expected ERRORLEVEL (-1)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '-1'
# Failed test 'qx/"test_perl_source.bat" -2/ returns expected 0 (254)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '254'
# Failed test '"test_perl_source.bat": `exit -2` set expected ERRORLEVEL (65534)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '65534'
# Failed test 'qx/"test_perl_source.bat" 65535/ returns expected 0 (255)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '255'
# Failed test '"test_perl_source.bat": `exit 65535` set expected ERRORLEVEL (65535)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '65535'
# Failed test 'qx/"test_perl_source.bat" 65536/ returns expected 0 (0)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '0'
# Failed test '"test_perl_source.bat": `exit 65536` set expected ERRORLEVEL (0)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '0'
# Failed test '`"test_perl_source.bat" 65536` process exit (PROCESS_FAILURE) is correct'
##[error]# at t/make_executable.t line 65.
# got: 'PROCESS_FAILURE'
# expected: 'PROCESS_SUCCESS'
# Failed test 'qx/"test_perl_source.bat" 65537/ returns expected 0 (1)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '1'
# Failed test '"test_perl_source.bat": `exit 65537` set expected ERRORLEVEL (1)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '1'
# Failed test 'qx/"test_perl_source.bat" 47/ returns expected 0 (47)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '47'
# Failed test '"test_perl_source.bat": `exit 47` set expected ERRORLEVEL (47)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '47'
# Failed test 'qx/"test_perl_source.bat" 100/ returns expected 0 (100)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '100'
# Failed test '"test_perl_source.bat": `exit 100` set expected ERRORLEVEL (100)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '100'
# Failed test 'qx/"test_perl_source.bat" 200/ returns expected 0 (200)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '200'
# Failed test '"test_perl_source.bat": `exit 200` set expected ERRORLEVEL (200)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '200'
# Failed test 'qx/"test_perl_source.bat" 255/ returns expected 0 (255)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '255'
# Failed test '"test_perl_source.bat": `exit 255` set expected ERRORLEVEL (255)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '255'
# Failed test 'qx/"test_perl_source.bat" 256/ returns expected 0 (0)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '0'
# Failed test '"test_perl_source.bat": `exit 256` set expected ERRORLEVEL (256)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '256'
# Failed test 'qx/"test_perl_source.bat" 257/ returns expected 0 (1)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '1'
# Failed test '"test_perl_source.bat": `exit 257` set expected ERRORLEVEL (257)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '257'
# Failed test 'qx/"test_perl_source.bat" 258/ returns expected 0 (2)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '2'
# Failed test '"test_perl_source.bat": `exit 258` set expected ERRORLEVEL (258)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '258'
# Failed test 'qx/"test_perl_source.bat" 511/ returns expected 0 (255)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '255'
# Failed test '"test_perl_source.bat": `exit 511` set expected ERRORLEVEL (511)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '511'
# Failed test 'qx/"test_perl_source.bat" 512/ returns expected 0 (0)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '0'
# Failed test '"test_perl_source.bat": `exit 512` set expected ERRORLEVEL (512)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '512'
# Failed test 'qx/"test_perl_source.bat" 513/ returns expected 0 (1)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '1'
# Failed test '"test_perl_source.bat": `exit 513` set expected ERRORLEVEL (513)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '513'
# Failed test 'qx/"test_perl_source.bat" -255/ returns expected 0 (1)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '1'
# Failed test '"test_perl_source.bat": `exit -255` set expected ERRORLEVEL (65281)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '65281'
# Failed test 'qx/"test_perl_source.bat" -256/ returns expected 0 (0)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '0'
# Failed test '"test_perl_source.bat": `exit -256` set expected ERRORLEVEL (65280)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '65280'
# Failed test 'qx/"test_perl_source.bat" -20012001/ returns expected 0 (31)'
##[error]# at t/make_executable.t line 63.
# got: '53'
# expected: '31'
# Failed test '"test_perl_source.bat": `exit -20012001` set expected ERRORLEVEL (42015)'
##[error]# at t/make_executable.t line 64.
# got: '-1073741515'
# expected: '42015'
# Looks like you failed 46 tests of 112.
t/make_executable.t ..
Dubious, test returned 46 (wstat 11776, 0x2e00)
Failed 46/112 subtests
Test Summary Report
-------------------
t/make_executable.t (Wstat: 11776 Tests: 112 Failed: 46)
Failed 1/2 test programs. 46/115 subtests failed.
Failed tests: 5-7, 10-11, 15-16, 20-21, 25-26, 30-31
35-36, 40-42, 45-46, 50-51, 55-56, 60-61
65-66, 70-71, 75-76, 80-81, 85-86, 90-91
95-96, 100-101, 105-106, 110-111
Non-zero exit status: 46
Files=2, Tests=115, 3 wallclock secs ( 0.08 usr + 0.01 sys = 0.09 CPU)
Result: FAIL
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.