Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

CPAN.pm says module is up-to-date, but running it says XS code is not built.

by jonadab (Parson)
on Sep 09, 2014 at 15:34 UTC ( #1100002=perlquestion: print w/replies, xml ) Need Help??

jonadab has asked for the wisdom of the Perl Monks concerning the following question:

cpan> install IO::Pty::HalfDuplex::SysctlPoll IO::Pty::HalfDuplex::SysctlPoll is up to date (undef). cpan> install IO::Pty::HalfDuplex::PTrace IO::Pty::HalfDuplex::PTrace is up to date (undef).
nathan@warthog:~$ perl -e ' use IO::Pty::HalfDuplex; my $pty = IO::Pty::HalfDuplex->new(backend => "SysctlPoll"); $pty->spawn("nethack") or warn "Spawn failed: $@$!"; print $pty->read; ' XS code for IO::Pty::HalfDuplex::SysctlPoll not built. at /usr/local/s +hare/perl/5.10.1/IO/Pty/HalfDuplex/SysctlPoll.pm line 44. BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/IO/P +ty/HalfDuplex/SysctlPoll.pm line 46. Compilation failed in require at (eval 2) line 3. nathan@warthog:~$ perl -e ' use IO::Pty::HalfDuplex; my $pty = IO::Pty::HalfDuplex->new(backend => "PTrace"); $pty->spawn("nethack") or warn "Spawn failed: $@$!"; print $pty->read; ' XS code for IO::Pty::HalfDuplex::PTrace not built. at /usr/local/share +/perl/5.10.1/IO/Pty/HalfDuplex/PTrace.pm line 45. BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/IO/P +ty/HalfDuplex/PTrace.pm line 47. Compilation failed in require at (eval 2) line 3. nathan@warthog:~$

So, how do I get the XS code built for these modules?

Replies are listed 'Best First'.
Re: CPAN.pm says module is up-to-date, but running it says XS code is not built.
by McA (Priest) on Sep 09, 2014 at 15:55 UTC

    Hi,

    the module IO::Pty::HalfDuplex::SysctlPoll you want to install is part of the distribution IO::Pty::HalfDuplex. So, you have to install this one via cpan.

    You may try to reinstall with:

    cpan> force install IO::Pty::HalfDuplex

    Regards
    McA

      Don't do that. That will install even if they are test failures. Use
      force test IO::Pty::HalfDuplex::SysctlPoll
      then, if the tests pass, you can use
      force install IO::Pty::HalfDuplex::SysctlPoll

        Thank you for correcting me.

        Once again I know why I use cpanm.

        Regards
        McA

Re: CPAN.pm says module is up-to-date, but running it says XS code is not built.
by Khen1950fx (Canon) on Sep 09, 2014 at 22:57 UTC
    IO::Pty::HalfDuplex has some portability problems. There's also the typo read. There is no method read:-). Use recv instead. Neither Ptrace nor SysctlPoll worked, even though the module passed all tests. Here's what worked for me:
    #!/usr/bin/perl use strict; use warnings; use IO::Pty::HalfDuplex; my $pty = IO::Pty::HalfDuplex->new; $pty->spawn("nethack") or warn "Spawn failed: $!"; unless ( $pty->is_active ) { warn "$pty is not active"; } else { print $pty->recv; }
Re: CPAN.pm says module is up-to-date, but running it says XS code is not built.
by ikegami (Pope) on Sep 09, 2014 at 21:07 UTC
    cpan's version checks simply extract the module's version from the .pm file. It doesn't run any tests. (It doesn't even load the module.) "Is up to date" is not a statement of the module's or the installation's fitness.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1100002]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2019-12-14 12:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?