Menu ▾ ▴

#18 Prototype mismatch: add_line_to_history

v1.0 (example)
closed-fixed
None
5
2015-06-21
2015-06-16
Yitz Gale
No

I am trying to run kpcli 2.8 for the first time on Mac OS X. I downloaded kpcli-2.8.pl, and installed the missing dependencies it complained about one by one using cpanminus. Now I get this:

Prototype mismatch: sub Term::ReadLine::Perl5::readline::add_line_to_history ($$) vs none at /Users/yitzg/bin/kpcli-2.8.pl line 4639.
Not an ARRAY reference at /System/Library/Perl/5.18/Term/ReadLine.pm line 307.

Any ideas? Thanks.

Discussion

  • Lester Hightower

    I need to know the versions of perl and Term::ReadLine::Perl5 that you are using. If kpcli will run, you can copy/paste the output of its vers command, else you'll need to just let me know yourself.

    As a work around do this bug, kpcli will prefer Term::ReadLine::Gnu if it's available. If you install that module you likely will get going until I can understand the issue with Term::ReadLine::Perl5, which I suspect is a newer version than I've tested against before.

     
  • Lester Hightower

    • assigned_to: Lester Hightower
     
  • Yitz Gale

    Yitz Gale - 2015-06-16
    $ perl -v
    
    This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level
    (with 2 registered patches, see perl -V for more detail)
    ...
    $ cpanm --info Term::ReadLine::Perl5
    ROCKY/Term-ReadLine-Perl5-1.41.tar.gz
    
     
  • Yitz Gale

    Yitz Gale - 2015-06-16

    As a work around do this bug, kpcli will prefer Term::ReadLine::Gnu if it's available.

    That's the classic issue on Mac OS X:

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    The libreadline you are using is the libedit library.  Use the GNU Readline Library.
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    -> N/A
    -> FAIL Configure failed for Term-ReadLine-Gnu-1.26.
    
     
  • Lester Hightower

    I spent some time looking at this. It seems to me that Term::ShellUI and recent Term::ReadLine::Perl5 aren't playing well together at all, at least not on Linux (and likely MaxOS X) and there does not appear to be any kpcli code triggering the problem. The support that I added for Term::ReadLine::Perl5 appears to have been at version 1.22 and was mostly targeted at Windows (although I'm sure it worked on Linux).

    I've chased this issue far enough that I'm likely to not look at it again for a while; diminishing returns for me. If you cpanm down your Term::ReadLine::Perl5 version to 1.22 (sudo cpanm -f Term::ReadLine::Perl5@1.22) you'll get further (at least I did), but will still hit problems; this time with history handling... Maybe some Term::ReadLine::Perl5 version newer than 1.22 but older then 1.41 will work for you, but at the moment I don't have time to walk through those and try them -- sorry.

     
  • Lester Hightower

    I spoke too soon... I tried one other Term::ReadLine::Perl5 version, 1.32, and it works.

    I don't intend to "walk" through all the Term::ReadLine::Perl5 versions any time soon, but 1.32 may get you going and maybe you can walk through them yourself and open a bug report with the Term::ReadLine::Perl5 maintainer...

    Sincerely,

    Lester

     
  • Lester Hightower

    • status: open --> pending-remind
     
  • Yitz Gale

    Yitz Gale - 2015-06-17

    It does work now with Term::ReadLine::Perl5@1.32, thanks!

    But I am not an active Perl programmer, so I'm not sure if I'm the one to investigate the problem any further. I had to fight hard with cpanm to get that downgraded. I'm not even sure which of the things I tried fixed it. And now cpanm seems to be in an inconsistent state; cpanm --info still reports that Term::ReadLine::Perl5 is at 1.41.

    If you give me specific commands to run, I'd be happy to give it a try and report back what happened.

    Thanks,
    Yitz

     
  • Lester Hightower

    The "cpanm --info" command shows you the most recent version available in CPAN -- has nothing to do with your local installation.

    If you can install pmtools (http://search.cpan.org/~mlfisher/pmtools-1.01/) then you can use its pmvers command to show you what you have installed, like so:

    hightowe@zion:~/$ pmvers Term::ReadLine::Perl5
    1.32

    There is a good chance that Term::ShellUI interaction with Term::ReadLine::Perl5 broke at some version greater than 1.32 and less than 1.41. Identifying which one and opening a bug report against Term::ReadLine::Perl5 would be a useful contribution, I think.

     
  • Yitz Gale

    Yitz Gale - 2015-06-18

    Reported in the p5-Term-ReadLine-Perl5 project as issue 8.

     
  • Rocky Bernstein

    Rocky Bernstein - 2015-06-19

    For the record until we get this fixed, the latest version of Term::ReadLine::Perl5 that works here is 1.38.

    Starting with 1.39, I tried integrating another line editing program Caroline to address two related issues. That Readline isn't OO, has a lot of global state and therefore you can't have nested readline sessions which is something that happens for example if you are in console program and try to debug something inside that.

     
  • Lester Hightower

    Term::ReadLine::Perl5 version 1.43 resolves this problem and so I am closing this bug.

     
    • Rocky Bernstein

      Rocky Bernstein - 2015-06-20

      Again though, thanks for all of the help.

       

      Last edit: Lester Hightower 2015-06-20
  • Lester Hightower

    • status: pending-remind --> closed-fixed
     
  • Yitz Gale

    Yitz Gale - 2015-06-21

    Verified that it works for me. Thanks!

     

Log in to post a comment.