Skip Menu |

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 130416
Status: open
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: shay [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.27-TRIAL2
Fixed in: (no value)



Subject: Running tests fails when installing modules in the CPAN shell if fork() isn't implemented
I've just done two builds of perl-5.31.3: One with, and one without fork(). (Actually, fork() emulation, since I'm on Windows. The emulation requires three win32/Makefile options to be turned on when building perl: USE_MULTI, USE_ITHREADS and USE_IMP_SYS. They are all turned on by default. My non-fork() build was done by simply turning off USE_IMP_SYS, which is a thing I often do.) In each build I then tried to install Win32::Process using CPAN (version 2.27-TRIAL2, the version bundled with perl-5.31.3). Using the perl that has fork() this worked perfectly. Using the perl without fork() I got these errors from the end of running "install Win32::Process" in the CPAN shell: Running make test for JDB/Win32-Process-0.16.tar.gz Catching error: "The fork function is unimplemented at D:\\Dev\\Temp\\mp2\\perl-noimpsys\\lib/CPAN/Distribution.pm line 3757.\cJ" at D:/Dev/Temp/mp2/perl-noimpsys/lib/CPAN.pm line 397. CPAN::shell() called at D:/Dev/Temp/mp2/perl-noimpsys/lib/App/Cpan.pm line 416 App::Cpan::_process_options("App::Cpan") called at D:/Dev/Temp/mp2/perl-noimpsys/lib/App/Cpan.pm line 512 App::Cpan::run("App::Cpan") called at D:\Dev\Temp\mp2\perl-noimpsys\bin/cpan.bat line 31 It appears that the CPAN shell is making some use of fork() to run tests when installing a module, and fails if fork() is not implemented. I tried the usual "perl Makefile.PL && nmake && nmake test" mantra in a standard cmd.exe shell and all was well, so the above fork() trouble is definitely coming from CPAN, not from anything that Win32::Process's test suite is doing.
Thank you, I didn't know that this is possible. First of all: can you tell how I can recognize this missing fork emulation? man perlfork and man perlport do not talk about this part of the world.
On Fri Aug 30 22:21:00 2019, ANDK wrote: Show quoted text
> Thank you, I didn't know that this is possible. First of all: can you > tell how I can recognize this missing fork emulation? man perlfork and > man perlport do not talk about this part of the world.
There are a couple of ways to check. The presence of a real fork() is indicated by $Config{d_fork}. The presence of the Windows fork() emulation is indicated by $Config{d_pseudofork}, but that is a fairly recent addition and won't work on older perls. For older perls on Windows you can tell if the fork() emulation is present by checking for ithreads and -DPERL_IMPLICIT_SYS. Examples of such checks exist in various places, e.g. see the following within the perl core: dist/IO/t/cachepropagate-tcp.t for modern perls cpan/Test-Simple/lib/Test2/Util.pm for older perls