Skip to content

omerbenamram/pypy_ffi_playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To generate bindings, some pypy macros are required (included in /include). I've used bindgen wrapper.h -o ./src/cpyext_ffi -- -I./Include

The main pain point is we need to manually rename the functions from their pypy expanded form PyPy.. to Py to keep convention (note that the link command are still valid for libpypy3-c)

I've used this simple script (yes - it should probably be included in the build.rs)

with open('/Users/omerba/Workspace/pypy_ffi/src/ffi_bindgen.rs', 'r') as f:
    src = f.read()

r = re.sub(r"(?!\".*)PyPy(?!.*\")", "Py", src)

with open('/Users/omerba/Workspace/pypy_ffi/src/ffi_bindgen.rs', 'w') as f:
    f.write(r)

(also had to renamed like 3 functions manually back to PyPy since they were included twice)

About

Getting pypy to play nice with rust cpyext

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published