Need help with a "NotImplementedError: internal inconsistency:" error in CFFI 1.0.0

18 views
Skip to first unread message

Sarvi Shanmugham

unread,
May 19, 2015, 6:40:53 PM5/19/15
to pytho...@googlegroups.com
I have one library libsparse.so that I am wrapping with CFFI 1.0.0
The *.py wrapper files were something that were working with CFFI 0.8.1 and I am porting to CFFI 1.0.0


It has 10 headers, such as lib.h, allocate.h, symbol.h, etc.
Each now has a wrapper python file, such as lib.py, allocate.py, symbol.py, etc

I have single setup.py file that looks like
from distutils.core import setup
#from setuptools import setup
import lib
import allocate
import token
import symbol
import scope
......
setup(
    name='sparse',
    description='Python Wrapper for the Sparse library.',
    packages=['sparse',],
    package_dir={'sparse' : '',},
    ext_modules=[
                 lib.ffi.distutils_extension(),
                 allocate.ffi.distutils_extension(),
                 token.ffi.distutils_extension(),
                 symbol.ffi.distutils_extension(),
                 scope.ffi.distutils_extension(),
                 ]
      )

I am seeing an error as below. 

NotImplementedError: internal inconsistency: <struct context_list>

I am not sure what that means.

Interestingly
    1. The content of these .py files are something that was working on 0.8.1
    2. When I compile the setup file for each of these .py files separately, by commenting the rest out, they compile and import fine. Its only when I put everything together that I have this error.

Can someone help with what might be going wrong here.
Thanks,
Sarvi

Armin Rigo

unread,
May 20, 2015, 2:45:32 AM5/20/15
to pytho...@googlegroups.com
Hi Sarvi,

On 20 May 2015 at 00:40, Sarvi Shanmugham <sarv...@gmail.com> wrote:
> NotImplementedError: internal inconsistency: <struct context_list>

As the error says, "internal inconsistency" should not occur. Please
provide a self-contained example that reproduces it and upload it to
the bugs tracker at https://bitbucket.org/cffi/cffi/issues .

> 2. When I compile the setup file for each of these .py files separately,
> by commenting the rest out, they compile and import fine. Its only when I
> put everything together that I have this error.

I don't really know your project, but my guess is that you need to
have only *one*, not *five* build scripts and ffi objects. See the
comment at the end of this section:

http://cffi.readthedocs.org/en/latest/cdef.html#ffi-include-combining-multiple-cffi-interfaces


A bientôt,

Armin.
Reply all
Reply to author
Forward
0 new messages