Skip to content

Add and by default build/use ctypes wrapper for FFI ntp library...

James Browning requested to merge ntpc into master

Instead of compiling a custom binary Python extension written in C (as is the case now), this uses Python's built-in FFI (foreign function interface) to interoperate with similar underlying C code in libntp.

The switch to the FFI approach frees us from worrying about Python's ABI changes.

Additionally, it means we could have bindings in other languages The primary (and currently only) consumer of the "ntp" Python module seems to be scripts in the NTPsec tree. But it's an option in principle.

When the libntp/ntp_c.c C ABI eventually changes, then the "ntp" module Python code needs to be updated in tandem. If libntp is internal, then we can change those in tandem in any release. If libntp is public, then there could be out-of-tree consumers of that C ABI and that would be a backward-incompatible change requiring a SONAME bump.

Thank you @rlaager for the much better text.

Alternatively, there is an unexposed switch in the code that will allow you to build/use the python extension if the new wrapper is not working.

Merge request reports