Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for compiled cffi pypy extensions, fixes #93 #94

Merged
merged 3 commits into from
Jul 3, 2018
Merged

Added support for compiled cffi pypy extensions, fixes #93 #94

merged 3 commits into from
Jul 3, 2018

Conversation

daa
Copy link
Contributor

@daa daa commented May 23, 2018

As said in corresponding issue CFFI extensions compiled for PyPy export '_cffi_pypyinit_' + modname symbol instead of usual Python module init functions, this pull request adds support for such wheels. Also by the way it fixes undefined variable mentioned in #91.

module_init_f = {
'init' + modname: 2,
'PyInit_' + modname: 3,
'_cffi_pypyinit_' + modname: 2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are 2 and 3 in this context? We might want to change these to named constants for legibility :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are versions of Python used to determine if extension may use ucs-2 functions. Corresponding code is in auditwheel.wheel_abi.get_wheel_elfdata. In case of CPython those numbers are really Python version but in case if pypy cffi python version cannot be derived from the name of module init function so I left 2 there.

@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change necessary?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see, this is a 2-for-1 to fix #91. Got it.

mayeut pushed a commit to mayeut/auditwheel that referenced this pull request Jun 10, 2018
- Remove libpanel and libncurses from the lib_whitelist (pypa#94)
- Generate symbol_versions
- Bump priority to 200.
@ehashman ehashman merged commit e3defcc into pypa:master Jul 3, 2018
@daa daa deleted the support-compiled-cffi-pypy-extensions branch July 4, 2018 21:48
ehashman pushed a commit that referenced this pull request Nov 18, 2018
- Remove libpanel and libncurses from the lib_whitelist (#94)
- Generate symbol_versions
- Bump priority to 200.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants