cffi uses inconsistent suffixes

Issue #110 resolved
Donald Stufft
created an issue

So I have my Verifier instance monkeypatched to prevent any runtime compilation at all. I noticed that this was failing with Python3.x. After digging into it more It's because the methods used by the Verifier is inconsistent with the method used by distutils.

Distutils uses distutls.sysconfig.get_config_var("EXT_SUFFIX") which returns ".so", however the Verifier() instance uses cffi.verifier._get_so_suffix() which returns "". Under the hood cffi.verifier._get_so_suffix() uses imp.get_suffixes().

I believe that either cffi should be smart enough to check all of the possible imp.C_EXTENSION suffixes from imp.get_suffixes() or it should use the same means that distutils does to determine what the suffix should be.

distutils code here:

Comments (3)

  1. Donald Stufft reporter

    To make this worse, PyPy distutils apparently does generate a so ending with, which is the opposite behavior to what CPython does on my machine :[

    Luckily that would still be solved by trying to load all the different types of suffixes.

  2. Donald Stufft reporter

    I have no idea what Windows does, but i've investigated this more.

    Linux -> distutils builds using the tagged .so's OSX -> distutils builds using plain .so's

  3. Log in to comment