rhandom / perl-net-server

Perl Module Net::Server
Other
14 stars 29 forks source link

Installation fails for non-threaded Perl #31

Closed PhilippSoehnlein closed 1 year ago

PhilippSoehnlein commented 1 year ago

When I try to install Net::Server on a Perl that isn't built with thread support the tests in t/Server_Thread.t cause the installation to fail.

From the cpanm install log:

--> Working on Net::Server
Fetching http://private-server/authors/id/R/RH/RHANDOM/Net-Server-2.013.tar.gz
-> OK
Unpacking Net-Server-2.013.tar.gz
Entering Net-Server-2.013
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.64)
Configuring Net-Server-2.013
Running Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Net::Server
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Time::HiRes 0 ... Yes (1.9760)
Checking if you have Socket 0 ... Yes (2.027)
Checking if you have File::Temp 0 ... Yes (0.2309)
Checking if you have POSIX 0 ... Yes (1.88)
Checking if you have IO::Socket 0 ... Yes (1.40)
Building and testing Net-Server-2.013
cp lib/Net/Server/Proto/UNIX.pm blib/lib/Net/Server/Proto/UNIX.pm
cp lib/Net/Server/Proto.pm blib/lib/Net/Server/Proto.pm
cp lib/Net/Server/Proto/SSL.pm blib/lib/Net/Server/Proto/SSL.pm
cp lib/Net/Server/SIG.pm blib/lib/Net/Server/SIG.pm
cp lib/Net/Server/Thread.pm blib/lib/Net/Server/Thread.pm
cp lib/Net/Server/Proto/UDP.pm blib/lib/Net/Server/Proto/UDP.pm
cp lib/Net/Server/Proto/UNIXDGRAM.pm blib/lib/Net/Server/Proto/UNIXDGRAM.pm
cp lib/Net/Server/HTTP.pm blib/lib/Net/Server/HTTP.pm
cp lib/Net/Server/Log/Sys/Syslog.pm blib/lib/Net/Server/Log/Sys/Syslog.pm
cp lib/Net/Server/Multiplex.pm blib/lib/Net/Server/Multiplex.pm
cp lib/Net/Server/MultiType.pm blib/lib/Net/Server/MultiType.pm
cp lib/Net/Server/PreFork.pm blib/lib/Net/Server/PreFork.pm
cp lib/Net/Server/Fork.pm blib/lib/Net/Server/Fork.pm
cp lib/Net/Server/Proto/TCP.pm blib/lib/Net/Server/Proto/TCP.pm
cp lib/Net/Server/Daemonize.pm blib/lib/Net/Server/Daemonize.pm
cp lib/Net/Server/Proto/SSLEAY.pm blib/lib/Net/Server/Proto/SSLEAY.pm
cp lib/Net/Server/Log/Log/Log4perl.pm blib/lib/Net/Server/Log/Log/Log4perl.pm
cp lib/Net/Server/PSGI.pm blib/lib/Net/Server/PSGI.pm
cp lib/Net/Server/INET.pm blib/lib/Net/Server/INET.pm
cp lib/Net/Server/Single.pm blib/lib/Net/Server/Single.pm
cp lib/Net/Server.pm blib/lib/Net/Server.pm
cp lib/Net/Server.pod blib/lib/Net/Server.pod
cp lib/Net/Server/PreForkSimple.pm blib/lib/Net/Server/PreForkSimple.pm
cp bin/net-server blib/script/net-server
"/path/to/perl5/perlbrew/perls/perl-5.30.3/bin/perl" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/net-server
PERL_DL_NONLAZY=1 "/path/to/perl5/perlbrew/perls/perl-5.30.3/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/Options.t ............... ok
t/Port_Configuration.t .... ok
t/Server_BASE.t ........... ok
t/Server_Fork.t ........... ok
t/Server_http.t ........... ok
t/Server_INET.t ........... ok
t/Server_Multiplex.t ...... ok
t/Server_MultiType.t ...... ok
t/Server_PreFork.t ........ ok
t/Server_PreForkSimple.t .. ok
t/Server_psgi.t ........... ok
t/Server_Single.t ......... ok
t/Server_Thread.t .........
Failed 1/5 subtests
        (less 4 skipped subtests: 0 okay)
t/SSL_test.t .............. ok
t/SSLEAY_test.t ........... ok
t/UDP_test.t .............. ok
t/UNIX_test.t ............. ok

Test Summary Report
-------------------
t/Server_Thread.t       (Wstat: 0 Tests: 5 Failed: 1)
  Failed test:  1
Files=17, Tests=195,  1 wallclock secs ( 0.07 usr  0.02 sys +  0.71 cusr  0.20 csys =  1.00 CPU)
Result: FAIL
Failed 1/17 test programs. 1/195 subtests failed.
make: *** [Makefile:888: test_dynamic] Error 255
-> FAIL Installing Net::Server failed. See /path/to/.cpanm/work/1670240338.2317164/build.log for details. Retry with --force to force install it.
-> FAIL Installing the dependencies failed: Module 'Net::Server' is not installed
-> FAIL Bailing out the installation for Net-Server-SS-PreFork-0.05.

When trying to run the test manually the actual error appears:

/path/to/.cpanm/work/1670240338.2317164/Net-Server-2.013$ prove -l -v t/Server_Thread.t
t/Server_Thread.t ..
1..5
not ok 1 - Can thread on this platform (This Perl not built to support threads
Compilation failed in require at /path/to/.cpanm/work/1670240338.2317164/Net-Server-2.013/t/NetServerTest.pm line 95.
)
#   failed at /path/to/.cpanm/work/1670240338.2317164/Net-Server-2.013/t/NetServerTest.pm line 56
ok 2 # skip Threads don't work on this platform
ok 3 # skip Threads don't work on this platform
ok 4 # skip Threads don't work on this platform
ok 5 # skip Threads don't work on this platform
Failed 1/5 subtests
    (less 4 skipped subtests: 0 okay)

Test Summary Report
-------------------
t/Server_Thread.t (Wstat: 0 Tests: 5 Failed: 1)
  Failed test:  1
Files=1, Tests=5,  0 wallclock secs ( 0.03 usr  0.00 sys +  0.02 cusr  0.00 csys =  0.05 CPU)
Result: FAIL

I built on Ubuntu 22.04 with a self-brewed perl (using perlbrew install 5.30.3) and then do a cpanm -L local Net::Server.

rhandom commented 1 year ago

I've applied a patch to help skip the tests after running them in a perlbrew env. Thank you for your report.