Features/TypesafeCtypes

From FedoraProject

Jump to: navigation, search


Contents

Type-safe "ctypes"

Summary

Owner

Current status

Note.png
This is just an idea at this point


Detailed Description

ctypes is a Python module that allows Python code to make arbitrary function calls into C libraries.

Unfortunately, such Python code needs to provide its own view of the layout of C-level type information, and if this is not in-sync with the actual C code, it it likely to segfault the python process.

The underlying libraries are built with the necessary information, for use by debugging tools, in "DWARF" format, but we strip this out and place it into "debuginfo" packages, since it is large.

The idea is to investigate if we can only strip part of the debuginfo, keeping the type information as part of the main library (assuming this doesn't get too large), and to then patch python, python3 and pypy to take account of this.

We may want to only do this for a subset of libraries e.g. the ones that are high-value for PyPy (e.g. database connectivity).

Potentially this could benefit other language runtimes that support similar FFI behavior.

Benefit to Fedora

This is (potentially) a distribution-wide change that would greatly improve the platform for use by PyPy, and thus Fedora would be an even better platform for PyPy usage.


Scope

TODO:

How To Test

User Experience

Dependencies

Contingency Plan

Documentation

Release Notes

Comments and Discussion