plack / Plack

PSGI toolkit and server adapters
http://plackperl.org/
Other
486 stars 214 forks source link

wrapcgi.t Fails when current Perl not in Path #618

Closed theory closed 6 years ago

theory commented 6 years ago

I started seeing this test failure recently:

Perl API version v5.20.0 of Cwd does not match v5.16.0 at /home/jenkins-slave/perl5/lib/perl5/x86_64-linux-thread-multi/XSLoader.pm line 114.
Compilation failed in require at /home/jenkins-slave/workspace/CentOS7-Perl-5.20/BUILD/Plack-1.0047/t/Plack-Middleware/cgi-bin/cgi_dir.cgi line 3.
BEGIN failed--compilation aborted at /home/jenkins-slave/workspace/CentOS7-Perl-5.20/BUILD/Plack-1.0047/t/Plack-Middleware/cgi-bin/cgi_dir.cgi line 3.

#   Failed test at t/Plack-Middleware/wrapcgi.t line 33.
#          got: '500'
#     expected: '200'

#   Failed test at t/Plack-Middleware/wrapcgi.t line 34.
#          got: '<html>
# <head><title>An Error Occurred</title></head>
# <body>
# <h1>An Error Occurred</h1>
# <p>500 Internal Server Error</p>
# </body>
# </html>
# '
#     expected: 'MATCH'
# Looks like you failed 2 tests of 6.
Failed 1/148 test programs. 2/1383 subtests failed.
make: *** [test_dynamic] Error 255
error: Bad exit status from /var/tmp/rpm-tmp.5BvWaf (%check)
    Bad exit status from /var/tmp/rpm-tmp.5BvWaf (%check)
ERROR: Plack-1.0047 Build failed

I think it's because I make my builds from a script that runs on the system Perl but that uses a separate Perl that's not in the path to make the builds. Since cgi_dir.cgi has this shebang:

#!/usr/bin/env perl

And the Perl that Plack is being built against (5.20) is not in the Path, it finds the system Perl (5.16) and runs that. The test goes away if I add 5.20 to the path. But I think the proper solution is to change the cgi_dir.cgi shebang to be the same as the other CGI test scripts:'

#!/usr/bin/perl

Which gets ignored by Perl. That's what's in the other CGI scripts (except utf8.cgi, which is #!perl, and also maybe should be changed).

theory commented 6 years ago

Hrm. That didn't fix it for me. Digging…

theory commented 6 years ago

Bah, turns out my RPM-building stuff got horked by local::lib. I'm having to rebuilt it all, and the test works fine now. Apologies for the noise.