On Tue, Nov 22, 2011 at 3:15 PM, nitralime <[email protected]> wrote:
> Hello!
>
> I'v tried to build lxml 2.3.2 with pypy 1.7 (linux64)
> and got the following error:
>
> ------------------------------------------------------------------------------------
> $ pypy setup.py build_ext -i
> pypy: /usr/lib/libssl.so.0.9.8: no version information available (required
> by pypy)
> pypy: /usr/lib/libcrypto.so.0.9.8: no version information available
> (required by pypy)
> Building lxml version 2.3.2.
> Building without Cython.
> Using build configuration of libxslt 1.1.26
> Building against libxml2/libxslt in the following directory: /usr/lib
> running build_ext
> building 'lxml.etree' extension
> creating build
> creating build/temp.linux-x86_64-2.7
> creating build/temp.linux-x86_64-2.7/src
> creating build/temp.linux-x86_64-2.7/src/lxml
> cc -fPIC -Wimplicit -I/usr/include/libxml2 -I/usr/local/pypy/include -c
> src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o
> -w
> src/lxml/lxml.etree.c: In function ‘__Pyx_PyObject_Pop’:
> src/lxml/lxml.etree.c:3683:16: error: ‘PyListObject’ has no member named
> ‘allocated’
> src/lxml/lxml.etree.c:3688:30: error: ‘PySet_Type’ undeclared (first use in
> this function)
> src/lxml/lxml.etree.c:3688:30: note: each undeclared identifier is reported
> only once for each function it appears in
> src/lxml/lxml.etree.c: In function
> ‘__pyx_f_4lxml_5etree_18_FileReaderContext__readDtd’:
> src/lxml/lxml.etree.c:72226:7: error: ‘_save’ undeclared (first use in this
> function)
> ....
> ...
> error: command 'cc' failed with exit status 1
> ------------------------------------------------------------------------------------
>
> Next I have tried the following (which is probabely a "nonsense"):
>
> ------------------------------------------------------------------------------------
> $ pypy setup.py build_ext -i -I/usr/include/python2.7
> pypy: /usr/lib/libssl.so.0.9.8: no version information available (required
> by pypy)
> pypy: /usr/lib/libcrypto.so.0.9.8: no version information available
> (required by pypy)
> Building lxml version 2.3.2.
> Building without Cython.
> Using build configuration of libxslt 1.1.26
> Building against libxml2/libxslt in the following directory: /usr/lib
> running build_ext
> building 'lxml.etree' extension
> cc -fPIC -Wimplicit -I/usr/include/libxml2 -I/usr/include/python2.7
> -I/usr/local/pypy/include -c src/lxml/lxml.etree.c -o
> build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
> cc -shared build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -L/usr/lib
> -lxslt -lexslt -lxml2 -lz -lm -o
> /home/nik/tmp/lxml-2.3.2/src/lxml/etree.pypy-17.so
> building 'lxml.objectify' extension
> cc -fPIC -Wimplicit -I/usr/include/libxml2 -I/usr/include/python2.7
> -I/usr/local/pypy/include -c src/lxml/lxml.objectify.c -o
> build/temp.linux-x86_64-2.7/src/lxml/lxml.objectify.o -w
> cc -shared build/temp.linux-x86_64-2.7/src/lxml/lxml.objectify.o -L/usr/lib
> -lxslt -lexslt -lxml2 -lz -lm -o
> /home/nik/tmp/lxml-2.3.2/src/lxml/objectify.pypy-17.so
> ------------------------------------------------------------------------------------
>
> $ PYTHONPATH=src pypy
> pypy: /usr/lib/libssl.so.0.9.8: no version information available (required
> by pypy)
> pypy: /usr/lib/libcrypto.so.0.9.8: no version information available
> (required by pypy)
> Python 2.7.1 (7773f8fc4223, Nov 18 2011, 18:47:11)
> [PyPy 1.7.0 with GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> And now for something completely different: ``happy new year''
>>>>> from lxml import etree
> Traceback (most recent call last):
>   File "<console>", line 1, in <module>
> ImportError: unable to load extension module
> '/home/nik/tmp/lxml-2.3.2/src/lxml/etree.pypy-17.so':
> /home/nik/tmp/lxml-2.3.2/src/lxml/etree.pypy-17.so: undefined symbol:
> PyClass_Type
>>>>>
>
> Has anyone ever tried to build lxml with pypy?
> What is the correct way to build an extension module?
>
> Any feedback is very much appreciated!
>
> Regards
> Nik
>

Hi.

lxml is unsupported because it's a cython-generated extension and
cython pokes inside internals of CPython objects. This is unsupported
and likely will never be (pypy objects are different enough). The fix
is to either fix cython or provide a different cython backend. There
was some work on the latter, but it did not go very far. For now you
have to assume lxml won't work on pypy unfortunately :-/

Cheers,
fijal
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to