The next version will have a better check for this.
This check ( $^V ) does not work for older Perls. Nevertheless, I can code for the contingency. What happens is this check will actually remove threading code from the source itself. Since threading is the default, and you said this can fail on some systems, as the check uses the default perl instead of the called one, the logical thing to do is to attempt to have non-threading as the default, and have the check modify the source to enabkle it. Thereby if the check failed with either the $^V or "perl -v" methods, it can still have a higher probability of working. The only thing suffering from a false check result is "which_console" not working. This is no big deal in the grand scheme of things. The threading usage is only a recent addition.
Nevertheless, many of the CPAN test failures have either been a lack of framebuffer drivers, or the test system automation was started from X-Windows, in which case it will always fail.
Usual indications of these CPAN tester failures are a MMAP error from the "Sys::Mmap" module. Which I have been receiving from CPAN long before the threading check (and usage) was added.
I should make changes to the test script in the "t/" directory to watch for this MMAP issue and better report on its cause of failure.
Working with a module so closely tied to kernel level systems is a nightmare for testing all contingencies, especially since Perl in taint mode really hates that, and taint mode is what perl tests run under.
On Fri Jun 17 00:12:55 2016, SREZIC wrote:
Show quoted text> The threaded perl check in Makefile.PL does not work if the current
> perl is not the system perl and not the first perl in user's $PATH.
> This can be fixed by using $^X instead of "perl" (see patch below).
>
> This explains the many test fails on CPAN Testers (most smoker
> machines do not use the system perl for testing).
>
>
> diff --git a/Makefile.PL b/Makefile.PL
> index d5af65f..188ec24 100644
> --- a/Makefile.PL
> +++ b/Makefile.PL
> @@ -40,7 +40,7 @@ if ($fg =~ /\d+/ || -e '/bin/fgconsole') {
> print "NOT FOUND\n\nWhile 'fgconsole' is not required, it is
> needed for the 'which_console' method to function.\n\n";
> }
>
> -my $perl_version = `perl -v`;
> +my $perl_version = `$^X -v`;
>
> if ($perl_version =~ /thread/) {
> print "Threaded Perl detected\n";