raku - 无法使用 Rakudo Perl 6 zef 安装 Readline

标签 raku rakudo rakudo-star zef

我正在尝试安装 Readline。

(系统是Linux Mint Mate 18.3,Lubuntu 17.10也是如此)。

$ zef install Readline

安装过程开始,但随后中止并显示以下消息:

===> Searching for: Readline
===> Searching for missing dependencies: LibraryCheck
===> Testing: LibraryCheck:ver<0.0.6>:auth<github:jonathanstowe>
===> Testing [OK] for LibraryCheck:ver<0.0.6>:auth<github:jonathanstowe>
===> Testing: Readline:ver<0.0.2>:auth<github:drforr>
# Failed test 'initialize'
# at t/02-base.t line 10
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'macro-dumper lives'
    # at t/02-base.t line 18
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Looks like you failed 1 test of 1
# Failed test 'dumpers'
# at t/02-base.t line 13
    # Failed test 'set-prompt lives'
    # at t/02-base.t line 27
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'expand-prompt lives'
    # at t/02-base.t line 29
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'on-new-line-with-prompt lives'
    # at t/02-base.t line 31
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'save-prompt lives'
    # at t/02-base.t line 33
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'restore-prompt lives'
    # at t/02-base.t line 35
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Looks like you failed 5 tests of 5
# Failed test 'prompt'
# at t/02-base.t line 24
    # Failed test 'tilde-expand lives'
    # at t/02-base.t line 46
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'tilde-expand-word lives'
    # at t/02-base.t line 48
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Looks like you failed 2 tests of 2
# Failed test 'tilde'
# at t/02-base.t line 39
    # Failed test 'prep-terminal lives'
    # at t/02-base.t line 58
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'deprep-terminal lives'
    # at t/02-base.t line 60
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'reset-terminal'
    # at t/02-base.t line 62
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Looks like you failed 3 tests of 3
# Failed test 'terminal'
# at t/02-base.t line 54
    # Failed test 'reset-line-state lives'
    # at t/02-base.t line 70
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Looks like you failed 1 test of 1
# Failed test 'state'
# at t/02-base.t line 68
    # Failed test 'free-undo-list lives'
    # at t/02-base.t line 81
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'do-undo lives'
    # at t/02-base.t line 83
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'begin-undo-group lives'
    # at t/02-base.t line 85
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'end-undo-group lives'
    # at t/02-base.t line 87
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Looks like you failed 4 tests of 4
# Failed test 'undo'
# at t/02-base.t line 80
    # Failed test 'funmap-names lives'
    # at t/02-base.t line 99
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Looks like you failed 1 test of 1
# Failed test 'funmap'
# at t/02-base.t line 91
    # Failed test 'set-screen-size'
    # at t/02-base.t line 106
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'reset-screen-size lives'
    # at t/02-base.t line 110
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Looks like you failed 2 tests of 2
# Failed test 'screen'
# at t/02-base.t line 103
    # Failed test 'insert-text lives'
    # at t/02-base.t line 118
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'delete-text lives'
    # at t/02-base.t line 120
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'kill-text lives'
    # at t/02-base.t line 122
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'copy-text lives'
    # at t/02-base.t line 124
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Looks like you failed 4 tests of 4
# Failed test 'text'
# at t/02-base.t line 114
    # Failed test 'make-bare-keymap lives'
    # at t/02-base.t line 132
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'copy-keymap lives'
    # at t/02-base.t line 134
    # Type check failed in binding to parameter '$map'; expected Readline::Keymap but got Any (Any)
    # Failed test 'make-keymap lives'
    # at t/02-base.t line 136
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'discard-keymap lives'
    # at t/02-base.t line 138
    # Type check failed in binding to parameter '$map'; expected Readline::Keymap but got Any (Any)
    # Failed test 'get-keymap-by-name lives'
    # at t/02-base.t line 145
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'get-keymap lives'
    # at t/02-base.t line 147
    # Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
    # Failed test 'get-keymap-name lives'
    # at t/02-base.t line 149
    # Type check failed in binding to parameter '$map'; expected Readline::Keymap but got Any (Any)
    # Failed test 'set-keymap lives'
    # at t/02-base.t line 151
    # Type check failed in binding to parameter '$map'; expected Readline::Keymap but got Any (Any)
    # Looks like you failed 8 tests of 8
# Failed test 'keymap'
# at t/02-base.t line 128
Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
  in method setup at /opt/rakudo-pkg/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 289
  in method CALL-ME at /opt/rakudo-pkg/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 576
  in method make-bare-keymap at /home/evb/.zef/store/perl6-readline.git/e2cf431a87c36d420a3f2737b2cbc160efeb9233/lib/Readline.pm (Readline) line 1040
  in sub  at t/02-base.t line 162
  in sub subtest at /opt/rakudo-pkg/share/perl6/sources/C712FE6969F786C9380D643DF17E85D06868219E (Test) line 411
  in sub  at t/02-base.t line 161
  in sub subtest at /opt/rakudo-pkg/share/perl6/sources/C712FE6969F786C9380D643DF17E85D06868219E (Test) line 411
  in block <unit> at t/02-base.t line 155

===> Testing [FAIL]: Readline:ver<0.0.2>:auth<github:drforr>
Aborting due to test failure: Readline:ver<0.0.2>:auth<github:drforr> (use --force-test to override)
  in code  at /home/evb/.perl6/sources/0061125F96D1E60B6E3B0001A4CB4D4188DF4869 (Zef::Client) line 375
  in method test at /home/evb/.perl6/sources/0061125F96D1E60B6E3B0001A4CB4D4188DF4869 (Zef::Client) line 353
  in code  at /home/evb/.perl6/sources/0061125F96D1E60B6E3B0001A4CB4D4188DF4869 (Zef::Client) line 530
  in sub  at /home/evb/.perl6/sources/0061125F96D1E60B6E3B0001A4CB4D4188DF4869 (Zef::Client) line 527
  in method install at /home/evb/.perl6/sources/0061125F96D1E60B6E3B0001A4CB4D4188DF4869 (Zef::Client) line 633
  in sub MAIN at /home/evb/.perl6/sources/C360CEB3AF792C33F65155FA82FDB7AB4467EC82 (Zef::CLI) line 152
  in block <unit> at bin/zef line 3

locate libreadline.so 给出以下输出:

/lib/x86_64-linux-gnu/libreadline.so.5
/lib/x86_64-linux-gnu/libreadline.so.5.2
/lib/x86_64-linux-gnu/libreadline.so.6
/lib/x86_64-linux-gnu/libreadline.so.6.3

最佳答案

许多发行版,包括 debian/ubuntu 和 friend 都鼓励在打包之间进行一定的分离,更多信息在 debian.org packaging docs .

特别是,它们鼓励为某些版本(例如 .so.1)分发共享库,这些版本是与“未版本化”.so 分开的其他包的依赖项> 更常用于“开发”(在以 -dev 结尾的分发包中)。

来自上述文档:

Please note that the development package should contain a symlink for the associated shared library without a version number. E.g.: /usr/lib/x86_64-linux-gnu/libfoo.so -> libfoo.so.1

对于 readline,该链接位于 libreadline-dev 包中,可以像这样安装在 mint/ubuntu/debian 类型的系统上:sudo apt-get install libreadline-dev

Perl 6 NativeCall文档也讨论了这个:

If you write native('foo') NativeCall will search libfoo.so under Unix like system (libfoo.dynlib on OS X, foo.dll on win32). In most modern system it will require you or the user of your module to install the development package because it's recommended to always provide an API/ABI version to a shared library, so libfoo.so ends often being a symbolic link provided only by a development package.

To avoid that, the native trait allows you to specify the API/ABI version. It can be a full version or just a part of it. (Try to stick to Major version, some BSD code does not care for Minor.)

看起来像 Readline does not specify a specific API/ABI version . (也许应该?)

既然没有,它就会寻找未版本化的共享库(纯 .so)。

关于raku - 无法使用 Rakudo Perl 6 zef 安装 Readline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48066536/

相关文章:

ncurses - 为什么在 delwin() 之后的 initscr() 返回 undef?

regex - perl6正则表达式匹配连词&&

variables - perl6 : do I need the @-sigil for userdefined variables?

perl - Rakudo Perl 中的套接字代码

jvm - 如何编译perl6程序生成字节码?

multidimensional-array - perl6 : access values in a multidimensional variable

raku - 为什么 Perl 6 的 Map 在一种情况下给我一个值而在另一种情况下给我一个列表?

Rakudo 测试套件进展?

error-handling - 将抛出的异常更改为失败的简洁方法?

user-interface - raku 用于 WINdows 8 的图形界面