• lxml with python-3.12.0a5

    From Robin Becker@21:1/5 to All on Thu Feb 23 13:03:26 2023
    I'm trying to test python-3.12.0a5 and need to install lxml.

    My wheel build for lxml fails with errors like this


    src/lxml/etree.c: In function ‘__Pyx_PyIndex_AsSsize_t’: src/lxml/etree.c:270404:45: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
    270404 | const digit* digits = ((PyLongObject*)b)->ob_digit;
    | ^~

    I'm using archlinux which has gcc 12.2.1. I tested and lxml will build with 3.11.2.

    I imagine this is part of ongoing changes to the python core, but perhaps there's some simple workaround.

    Anyone know how to get around this problem. I did try rebuilding the cpython stuff using make, but that also failed.

    --
    Robin Becker

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mats Wichmann@21:1/5 to Robin Becker on Thu Feb 23 07:47:04 2023
    On 2/23/23 06:03, Robin Becker wrote:
    I'm trying to test python-3.12.0a5 and need to install lxml.

    My wheel build for lxml fails with errors like this


    src/lxml/etree.c: In function ‘__Pyx_PyIndex_AsSsize_t’: src/lxml/etree.c:270404:45: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
    270404 |     const digit* digits = ((PyLongObject*)b)->ob_digit;
           |                                             ^~

    I'm using archlinux which has gcc 12.2.1. I tested and lxml will build
    with 3.11.2.

    I imagine this is part of ongoing changes to the python core, but
    perhaps there's some simple workaround.

    Anyone know how to get around this problem. I did try rebuilding the
    cpython stuff using make, but that also failed.

    I seem to always have trouble with lxml (which I know doesn't help).

    The cause would seem to be this:

    GH-101291: Refactor the `PyLongObject` struct into object header
    and PyLongValue struct. (GH-101292)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mats Wichmann@21:1/5 to Mats Wichmann on Thu Feb 23 11:09:29 2023
    On 2/23/23 07:47, Mats Wichmann wrote:
    On 2/23/23 06:03, Robin Becker wrote:
    I'm trying to test python-3.12.0a5 and need to install lxml.

    My wheel build for lxml fails with errors like this


    src/lxml/etree.c: In function ‘__Pyx_PyIndex_AsSsize_t’:
    src/lxml/etree.c:270404:45: error: ‘PyLongObject’ {aka ‘struct
    _longobject’} has no member named ‘ob_digit’
    270404 |     const digit* digits = ((PyLongObject*)b)->ob_digit;
            |                                             ^~

    I'm using archlinux which has gcc 12.2.1. I tested and lxml will build
    with 3.11.2.

    I imagine this is part of ongoing changes to the python core, but
    perhaps there's some simple workaround.

    Anyone know how to get around this problem. I did try rebuilding the
    cpython stuff using make, but that also failed.

    I seem to always have trouble with lxml (which I know doesn't help).

    The cause would seem to be this:

        GH-101291: Refactor the `PyLongObject` struct into object header
    and PyLongValue struct. (GH-101292)

    So it looks to me like cython was affected, and has patched themselves.
    It's possible regenerating with a patched cython will clear up the build problem (something which the lxml project takes pains to tell you that
    you don't really want to do :)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robin Becker@21:1/5 to Mats Wichmann on Fri Feb 24 09:04:22 2023
    On 23/02/2023 18:09, Mats Wichmann wrote:
    ........
    I seem to always have trouble with lxml (which I know doesn't help).

    The cause would seem to be this:

         GH-101291: Refactor the `PyLongObject` struct into object header and PyLongValue struct. (GH-101292)

    So it looks to me like cython was affected, and has patched themselves. It's possible regenerating with a patched cython
    will clear up the build problem (something which the lxml project takes pains to tell you that you don't really want to
    do :)
    Thanks Mats,

    I build a cython wheel from git latest and after installing into python-3.12.0a5 I used latest lxml source and

    python setup.py bdist_wheel --with-cython

    which built without error. The installed lxml seems fine (at least for reportlab tests).
    --
    Robin Becker

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)