XML::LibXLM 未安装在 ubuntu 22.04 上

问题描述 投票:0回答:1

我在 ubuntu 22.04 上使用 cpan 安装 XML::LibXML 时遇到问题。 我已经安装了 libxml2 和 zlib1g。 CPAN 报告说它看到了 libxml2:

# Compiled against libxml2 version: 21303
# Running libxml2 version:          21303

所有软件包要求均已安装。 (如果您需要查看版本号,我可以列出它们),但全部都存在)

有一些警告。还有一些失败的测试。但安装本身失败:

Files=77, Tests=2546, 11 wallclock secs ( 0.62 usr  0.14 sys +  9.57 cusr  1.35 csys = 11.68 CPU)
Result: FAIL
Failed 4/77 test programs. 3/2546 subtests failed.
make: *** [Makefile:1327: test_dynamic] Error 255
  SHLOMIF/XML-LibXML-2.0210.tar.gz
  /bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports SHLOMIF/XML-LibXML-2.0210.tar.gz


我尝试的是:

cpan XML::LibXML

针对某些已贬值的内容显示了一些警告:

x86_64-linux-gnu-gcc -c  -I/usr/local/lib/x86_64-linux-gnu/perl/5.34.0/auto/share/dist/Alien-Libxml2/include/libxml2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno
-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"2.0210\" -DXS_VERSION=\"2.0210\" -fPIC "-I/usr/lib/x86_64
-linux-gnu/perl/5.34/CORE"  -DHAVE_UTF8 perl-libxml-sax.c
perl-libxml-sax.c: In function 'PmmSaxError':
perl-libxml-sax.c:1539:28: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifi
ers]
 1539 |     xmlErrorPtr last_err = xmlCtxtGetLastError( ctxt );
      |     
                   ^~~~~~~~~~~~~~~~~~~

有些测试失败了:

t/19die_on_invalid_utf8_rt_58848.t ................. 
#   Failed test 'Parser error.'
#   at t/19die_on_invalid_utf8_rt_58848.t line 19.
#                   'example/thedieline.rss:26: I/O error : Invalid bytes in character encoding
# .com%2fblog%2f2010%2f06%2fginja-d-%25c3%25b3bidos.html&t=Ginja+d%26%2339%3b+
#                                                                                 ^
# example/thedieline.rss:26: parser error : Entity 'ldquo' not defined
# log%2f2010%2f06%2fginja-d-%25c3%25b3bidos.html&t=Ginja+d%26%2339%3b+�“

Test Summary Report
-------------------
t/02parse.t                                      (Wstat: 256 Tests: 533 Failed: 1)
  Failed test:  511
  Non-zero exit status: 1
t/08findnodes.t                                  (Wstat: 256 Tests: 45 Failed: 1)
  Failed test:  14
  Non-zero exit status: 1
t/19die_on_invalid_utf8_rt_58848.t               (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
t/60error_prev_chain.t                           (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 1 tests but ran 0.
Files=77, Tests=2546, 11 wallclock secs ( 0.62 usr  0.14 sys +  9.57 cusr  1.35 csys = 11.68 CPU)
Result: FAIL
Failed 4/77 test programs. 3/2546 subtests failed.
make: *** [Makefile:1327: test_dynamic] Error 255
  SHLOMIF/XML-LibXML-2.0210.tar.gz
  /bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports SHLOMIF/XML-LibXML-2.0210.tar.gz

任何帮助表示赞赏 - Dean Guenther

libxml2 cpan
1个回答
0
投票

好消息,我终于成功了。我做了三件事,但我不确定哪件事起作用了:

  1. 首先,我在某处找到了一个帖子,表明要这样做:

安装 libxml-libxml-perl

我这样做并重试安装 XML::LibXML 但仍然失败。

  1. 然后我看到另一篇文章,几年前有人遇到了麻烦,他们最终更新了所有 ubuntu 软件包。

  2. 另一篇文章说要更新所有 CPAN 软件包。

在这三者之间,我现在能够构建 XML::LibXML。 - 院长

© www.soinside.com 2019 - 2024. All rights reserved.