Skip to content

Commit

Permalink
Merge pull request #94 from daa/support-compiled-cffi-pypy-extensions
Browse files Browse the repository at this point in the history
Added support for compiled cffi pypy extensions, fixes #93
  • Loading branch information
ehashman authored Jul 3, 2018
2 parents 97cfb2d + 1f381bc commit e3defcc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion auditwheel/elfutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ def elf_references_PyFPE_jbuf(elf: ELFFile) -> bool:

def elf_is_python_extension(fn, elf) -> Tuple[bool, Optional[int]]:
modname = basename(fn).split('.', 1)[0]
module_init_f = {'init' + modname: 2, 'PyInit_' + modname: 3}
module_init_f = {
'init' + modname: 2,
'PyInit_' + modname: 3,
'_cffi_pypyinit_' + modname: 2,
}

sect = elf.get_section_by_name('.dynsym')
if sect is None:
Expand Down
3 changes: 2 additions & 1 deletion auditwheel/repair.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ def copylib(src_path, dest_dir):
with open(src_path, 'rb') as f:
shorthash = hashfile(f)[:8]

base, ext = os.path.basename(src_path).split('.', 1)
src_name = os.path.basename(src_path)
base, ext = src_name.split('.', 1)
if not base.endswith('-%s' % shorthash):
new_soname = '%s-%s.%s' % (base, shorthash, ext)
else:
Expand Down
Binary file not shown.
9 changes: 9 additions & 0 deletions tests/test_bundled_pypy_snappy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from auditwheel.wheel_abi import analyze_wheel_abi


def test_analyze_wheel_abi_pypy_cffi():
winfo = analyze_wheel_abi(
'tests/python_snappy-0.5.2-pp260-pypy_41-linux_x86_64.whl')
external_libs = winfo.external_refs['manylinux1_x86_64']['libs']
assert len(external_libs) > 0
assert set(external_libs) == {'libsnappy.so.1'}

0 comments on commit e3defcc

Please sign in to comment.