Re: XML test error on Arch Linux
Erik Wienhold <ewie@ewie.name>
From: Erik Wienhold <ewie@ewie.name>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Frank Streitzig <fstreitzig@gmx.net>, pgsql-hackers@lists.postgresql.org
Date: 2024-07-06T18:24:35Z
Lists: pgsql-hackers
Attachments
- libxml2.13-fixes.patch (text/x-diff) patch
On 2024-07-06 16:25 +0200, Tom Lane wrote:
> Erik Wienhold <ewie@ewie.name> writes:
> > So, there must be breaking changes in 2.13.0:
> > https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.13.0
>
> Yeah, apparently --- I get what look like the same diffs with
> libxml2 2.13.0 recently supplied by MacPorts. Grumble.
> Somebody's going to have to look into that.
Here's a patch that fixes just the xmlserialize and namespace errors.
Use xmlAddChildList instead of xmlAddChild for xmlserialize. That also
works with 2.12.7, but I don't know about older libxml2 versions. Maybe
add a version check to be safe:
#if LIBXML_VERSION >= 21300
xmlAddChildList(root, content_nodes);
#else
xmlAddChild(root, content_nodes);
#endif
I don't know if using xmlAddChild in this context was ever correct.
The namespace errors are tricky because xmlParseBalancedChunkMemory now
returns res_code != 0 for invalid or unknown namespaces (probably other
errors as well). So I just added an additional check to ignore those
errors for >=2.13. But that's rather hackish. I don't know how to
handle it in xml_errorHandler where those error codes are already dealt
with in order to compensate for differences in error reporting across
different libxml2 versions. Looks like xmlerrcxt is ignored by
xmlParseBalancedChunkMemory.
No idea how to deal with the remaining errors for invalid and undefined
entities which appear to include less details now. That seems to be
expected, judging from the release notes:
> A few error messages were improved and consolidated. Please update
> downstream test suites accordingly.
How to deal with that in a manner that still works for pre-2.13, other
than filtering out those details that are no longer included in 2.13?
Or just \set VERBOSITY terse for those few test cases? But that omits
the entire error detail.
--
Erik
Commits
-
Make our back branches compatible with libxml2 2.13.x.
- f85c91a1867b 16.4 landed
- f68d6aabb7e2 15.8 landed
- a9747be27288 17.0 landed
- a134baea7ab0 12.20 landed
- 48132587d9bc 13.16 landed
- 475e1807c20f 14.13 landed
-
Remove new XML test cases added by e7192486d.
- 896cd266fd34 18.0 landed
-
Suppress "chunk is not well balanced" errors from libxml2.
- e7192486dded 18.0 landed
-
Use xmlParseInNodeContext not xmlParseBalancedChunkMemory.
- 6082b3d5d3d1 18.0 landed
-
Use xmlAddChildList not xmlAddChild in XMLSERIALIZE.
- 066e8ac6ea8b 18.0 landed