Skip to content

Conversation

@nwellnhof
Copy link
Contributor

Make the test suite work with the upcoming 2.13.0 release of libxml2.

@shlomif
Copy link
Owner

shlomif commented Jun 24, 2024

@nwellnhof : hi! Sorry it took me long to review this pull-request. The first issue with it is that Test::Count annotations are missing: https://metacpan.org/pod/Test::Count .

The second issue is that backward compatibility may have been broken too - including in https://metacpan.org/dist/XML-Grammar-ProductsSyndication . So I'm not sure this is the right direction.

What do you think?

@nwellnhof
Copy link
Contributor Author

The first issue with it is that Test::Count annotations are missing:

I don't know how to fix this.

The second issue is that backward compatibility may have been broken too

What do you mean exactly? Did you find a regression?

@shlomif
Copy link
Owner

shlomif commented Jun 25, 2024

Hi @nwellnhof !

The first issue with it is that Test::Count annotations are missing:

I don't know how to fix this.

Just add "# TEST" comments to account for the new test assertions.

The second issue is that backward compatibility may have been broken too

What do you mean exactly? Did you find a regression?

Well, Perl 5 code that used to work in the past (like the one in the tests' suite or that of my ProductsSyndication module, ) stopped working. It now throws runtime errors.

@nwellnhof nwellnhof force-pushed the test-suite-libxml2 branch from 482715a to bee8338 Compare June 25, 2024 17:02
@nwellnhof
Copy link
Contributor Author

Just add "# TEST" comments to account for the new test assertions.

I added a "# TEST" comment for the new test and force-pushed.

Well, Perl 5 code that used to work in the past (like the one in the tests' suite or that of my ProductsSyndication module, ) stopped working. It now throws runtime errors.

The only things that have changed are error messages and bug fixes. I you found a regression, please open issue at https://gitlab.gnome.org/GNOME/libxml2/-/issues

@shlomif
Copy link
Owner

shlomif commented Jun 25, 2024

@nwellnhof : thanks! I'll try to investigate soon,

clrpackages pushed a commit to clearlinux-pkgs/perl-XML-LibXML that referenced this pull request Jan 24, 2025
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Feb 6, 2025
https://build.opensuse.org/request/show/1239251
by user pgajdos + anag+factory
- Fix the testsuite with libxml2 version 2.13.0 and up:
  * github.com/shlomif/perl-XML-LibXML/pull/87
  * Add perl-XML-LibXML-fix-testsuite-with-libxml2-2.13.patch (forwarded request 1239241 from pmonrealgonzalez)
@nwellnhof
Copy link
Contributor Author

Updated for the upcoming libxml2 2.14 release.

@Tux
Copy link

Tux commented Mar 14, 2025

I verified that clearlinux-pkgs/perl-XML-LibXML@7a00fd4#diff-1f9336e73dd201547c9d20e125f3c1f39548ee21b7cf94e09e8639978c3bd37f indeed fixes XML::LibXML on

Linux 6.13.6-1-default [openSUSE Tumbleweed 20250311]  HP ZBook Power15.6inchG10AMobileWorkstationPC AMD Ryzen 9 7940HS w/ Radeon 780M Graphics (AuthenticAMD 1097MHz)(16 cores) x86_64  62057 Mb
This is perl 5, version 40, subversion 1 (v5.40.1) built for x86_64-linux-thread-multi-quadmath
gcc (SUSE Linux) 14.2.1 20250220 [revision 9ffecde121af883b60bbe60d00425036bc873048]
libxml2-2-2.13.6-1.2.x86_64
libxml2-devel-2.13.6-1.2.x86_64

All tests successful.
Files=77, Tests=2548,  4 wallclock secs ( 0.15 usr  0.07 sys +  2.46 cusr  0.61 csys =  3.29 CPU)
Result: PASS

@ernstki
Copy link

ernstki commented Apr 1, 2025

Can confirm also that this patch fixes the test failures using cpanm on Debian Stable, with libxml 2.9.14 from the distro repositories:

$ cpanm -L extlib --self-contained XML::LibXML

Failed 8/77 test programs. 9/2546 subtests failed.
make: *** [Makefile:1202: test_dynamic] Error 255
-> FAIL Installing XML::LibXML failed. See /root/.cpanm/work/1743536186.30209/build.log for details. Retry with --force to force install it.

This is inside a Docker container so please don't freak out that I'm building it as root. ;)

Downloading and applying the patch from this PR:

cd ~/.cpanm/work/1743536186.30209
cd XML-LibXML-2.0210
wget https://patch-diff.githubusercontent.com/raw/shlomif/perl-XML-LibXML/pull/87.diff
patch -p1 <87.diff
perl Makefile.PL  # or, in my case: perl -Mlocal::lib=$HOME/src/extlib Makefile.PL
make install

@pdxbug
Copy link

pdxbug commented May 7, 2025

@shlomif when will this get merged and released? Getting this error trying to update a system to Cento 9

Line numbers are always enabled since libxml2 2.15.0.
@doko42
Copy link

doko42 commented Jun 9, 2025

fyi, I applied the proposed patch for the most recent Ubuntu build:
https://launchpad.net/ubuntu/+source/libxml-libxml-perl/2.0207+dfsg+really+2.0207-0ubuntu5

still using 2.0207, I see these test failures:

t/18docfree.t ...................................... 
1..1
ok 1 - docfree Out of scope is OK - no "Attempt to free unreferenced scalar"
ok

#   Failed test 'Parser error.'
#   at t/19die_on_invalid_utf8_rt_58848.t line 19.
#                   'Could not create file parser context for file "example/thedieline.rss": No such file or directory at t/19die_on_invalid_utf8_rt_58848.t line 13.
# '
#     doesn't match '(?^:not proper UTF-8|Invalid bytes in character encoding)'
# Looks like you failed 1 test of 1.
t/19die_on_invalid_utf8_rt_58848.t ................. 
1..1
not ok 1 - Parser error.
Dubious, test returned 1 (wstat 256, 0x100)


#   Failed test 'exception thrown during parse'
#   at t/35huge_mode.t line 58.
#          got: ''
#     expected: anything else

#   Failed test 'exception refers to entity reference loop'
#   at t/35huge_mode.t line 60.
#                   ''
#     doesn't match '(?^si:entity.*loop)'
# Looks like you failed 2 tests of 5.
t/35huge_mode.t .................................... 
1..5
ok 1 - huge mode disabled by default
not ok 2 - exception thrown during parse
not ok 3 - exception refers to entity reference loop
ok 4 - no exception thrown during parse
ok 5 - entity was parsed and expanded correctly
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/5 subtests 


t/48importing_nodes_IDs_rt_69520.t ................. 
1..4
ok 1 - Orig doc has id1
ok 2 - Content of orig doc elem id1
ok 3 - Doc2 after importNode has id1
ok 4 - Doc2 after importNode has id1
ok
Cannot open 'example/yahoo-finance-html-with-errors.html' for slurping - No such file or directory at t/l
ib/TestHelpers.pm line 31.
# Looks like your test exited with 2 before it could output anything.
t/49_load_html.t ................................... 
1..3
Dubious, test returned 2 (wstat 512, 0x200)
Failed 3/3 subtests 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants