Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 917562 - dev-python/lxml-4.9.3-r2 fails to build with libxml2-2.12.0 (clang-17 as system compiler)
Summary: dev-python/lxml-4.9.3-r2 fails to build with libxml2-2.12.0 (clang-17 as syst...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Python Gentoo Team
URL:
Whiteboard: fixed in 5.0.1
Keywords:
Depends on:
Blocks: c99-porting libxml2-2.12
  Show dependency tree
 
Reported: 2023-11-18 10:49 UTC by Chris Pritchard
Modified: 2024-10-31 13:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_917562.txt,15.82 KB, text/plain)
2023-11-18 10:49 UTC, Chris Pritchard
Details
build.log (file_917562.txt,37.58 KB, text/plain)
2023-11-18 10:50 UTC, Chris Pritchard
Details
dev-python/lxml: avoid suppressing compiler warnings (0001-dev-python-lxml-avoid-suppressing-compiler-warnings.patch,971 bytes, patch)
2023-11-19 02:46 UTC, Eli Schwartz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Pritchard 2023-11-18 10:49:14 UTC
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
Comment 1 Chris Pritchard 2023-11-18 10:49:39 UTC
Created attachment 875133 [details]
emerge --info
Comment 2 Chris Pritchard 2023-11-18 10:50:21 UTC
Created attachment 875134 [details]
build.log
Comment 3 Eli Schwartz gentoo-dev 2023-11-19 02:46:31 UTC
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.
Comment 4 Larry the Git Cow gentoo-dev 2023-11-19 06:34:34 UTC
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(+)
Comment 5 Eli Schwartz gentoo-dev 2023-11-19 07:53:38 UTC
Sorry, just to clarify -- my patch doesn't fix this ticket, it just makes sure you can reproduce the bug with GCC too. :)
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-01 19:52:10 UTC
actually I'll file a new bug for the <2.12.0 issue
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-06 08:02:27 UTC
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>