when compiling lxml-4.9.3-r2 with libxml2-2.12.0 there are several errors predominantly "incompatible function pointer types assigning to 'xmlStructuredErrorFunc' Reproducible: Always Steps to Reproduce: 1.Install libxml2-2.12.0 2.Have clang as system compiler (don't have a GCC system to test this on) 3.Emerge lxml-4.9.3-r2 Actual Results: src/lxml/etree.c:129877:38: error: incompatible function pointer types assigning to 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') from 'void (void *, xmlError *)' (aka 'void (void * , struct _xmlError *)') [-Wincompatible-function-pointer-types] 129877 | __pyx_v_self->_c_ctxt->sax->serror = __pyx_f_4lxml_5etree__receiveParserError; | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/lxml/etree.c:134391:25: error: incompatible function pointer types assigning to 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') from 'void (void *, xmlError *)' (aka 'void (void * , struct _xmlError *)') [-Wincompatible-function-pointer-types] 134391 | __pyx_v_sax->serror = __pyx_f_4lxml_5etree__receiveParserError; | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/lxml/etree.c:203020:28: error: incompatible function pointer types assigning to 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') from 'void (void *, xmlError *)' (aka 'void (void * , struct _xmlError *)') [-Wincompatible-function-pointer-types] 203020 | __pyx_v_xpathCtxt->error = __pyx_f_4lxml_5etree__receiveXPathError; | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Expected Results: Package builds and installs
Created attachment 875133 [details] emerge --info
Created attachment 875134 [details] build.log
Created attachment 875164 [details, diff] dev-python/lxml: avoid suppressing compiler warnings On a GCC system I get several errors with -Werror=incompatible-pointer-types. Especially noteworthy: - I get these errors even with the *older* libxml2. - I get no errors at all by default, since lxml requires `setup.py --warnings` or else it injects `-w`. On point 2, this seems generally problematic. Enclosed is a patch to make it respect warnings again.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09a48d7649ff8ec54062a0aa41d675aa3c0e88f9 commit 09a48d7649ff8ec54062a0aa41d675aa3c0e88f9 Author: Eli Schwartz <eschwartz93@gmail.com> AuthorDate: 2023-11-19 02:41:55 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2023-11-19 06:32:17 +0000 dev-python/lxml: avoid suppressing compiler warnings By default, setupinfo.py injects `-w` to the CFLAGS passed down to Extension objects. This obscures things we'd like to see. For example, it prevents adding Modern C Porting flags. Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> Closes: https://bugs.gentoo.org/917562 Signed-off-by: Michał Górny <mgorny@gentoo.org> dev-python/lxml/lxml-4.9.3-r2.ebuild | 4 ++++ 1 file changed, 4 insertions(+)
Sorry, just to clarify -- my patch doesn't fix this ticket, it just makes sure you can reproduce the bug with GCC too. :)
actually I'll file a new bug for the <2.12.0 issue
commit 9effc95f9d3269d3779c5f2e76c879c992c1c67c Author: Michał Górny <mgorny@gentoo.org> Date: Sat Jan 6 06:47:10 2024 +0100 dev-python/lxml: Bump to 5.0.1 Signed-off-by: Michał Górny <mgorny@gentoo.org>