1

Is there a way, given a module on CPAN to determine if that module can run in the Perl Compiler, (perlcc).

If I try to compile the testing suite itself, running the ./t files does not produce any output.

Here is test.t,

#!/usr/bin/perl
use Test::More;  
ok(1);
done_testing;

If I run it I get,

$ perl ./t/test.t 
ok 1
1..1

But if I compile it using perlcc ./t/test.t and run that ./t/test I get no output.

Is there a method to test a module for compatibility with the Perl compiler?

Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
  • How did you install `perlcc` ? I am not able to install it (`cpanm B::C`) on Ubuntu 20.04 with perl version 5.30. Do you need to use an older `perl`? – Håkon Hægland Feb 17 '21 at 00:18
  • @HåkonHægland Not sure what error you're getting works fine for me. I downloaded and built it from github. https://metacpan.org/pod/B::C https://github.com/rurban/perl-compiler – Evan Carroll Feb 17 '21 at 08:28
  • I tried installing from github now, and some of the tests (`make test`) still fails. Which Perl version are you using? – Håkon Hægland Feb 17 '21 at 09:38

1 Answers1

1

The answer is:

Yes, compile and run it with perlcc to see if it works.

You can also check the log.modules* lists at https://github.com/rurban/perl-compiler/ or with the compiler, to see if your modules compiles with your particular perl version. It depends on the version, threaded or not (nt) or cperl (c) or perl5.

Until 5.24 or so about 95% of all modules, as well as the full perl5 core testsuite tested fine. Later p5p broke it and refused to fix its regressions. That's why you have to use cperl, where the perl5 bugs were fixed and where it's supported.

rurban
  • 4,025
  • 24
  • 27