Skip to content
Snippets Groups Projects

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

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 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.

    Ahh, I see "unexposed" now. I think we should either expose this option or not have the choice (as was the case in previous versions of this code). I assume the intention was that the option would be a temporary escape hatch in case there is a problem. So I don't really care which we do, since it is going away in a release or two.

  • James Browning added 1 commit

    added 1 commit

    • f85b1101 - FFI: Find that vnum sets the version backward in build and right installed

    Compare with previous version

  • I have the Codacy URL open. That was one of the 5 formatting errors you reported before polymorphed. When it decides what it wants I will address it if there is nothing more pressing.

  • added 1 commit

    • fa481593 - ntp.ntpc: Change importado docstring to hopefully conform.

    Compare with previous version

  • added 1 commit

    • 093f8fae - ntp.ntpc: Change importado docstring to hopefully conform. -r1

    Compare with previous version

  • added 1 commit

    • d446d389 - ntp.ntpc: Change importado docstring to hopefully conform. -r2

    Compare with previous version

  • added 1 commit

    • 212f9291 - ntp.ntpc: Change importado docstring to hopefully conform. -r3

    Compare with previous version

  • Good, light is red so there are still 'issues' to resolve and I am not getting a droid notification for each one.

  • James Browning added 6 commits

    added 6 commits

    • 6b2491a8 - 1 commit from branch master
    • ee3e2f8b - build, pylib: ntpc... some singing/dancing
    • 70f0be40 - ntpc, ffi: Do _not_ rebuild on install. Doh.
    • 15d473fd - Feed it to the garbage smasher. -r2
    • 3afdae44 - FFI: Find that vnum sets the version backward in build and right installed
    • 29fa43c9 - ntp.ntpc: Change importado docstring to hopefully conform. -r4

    Compare with previous version

  • added 1 commit

    • d1c9cbda - ntp.ntpc: Change importado docstring to hopefully conform. -r5

    Compare with previous version

  • mentioned in issue #667 (closed)

  • James Browning added 4 commits

    added 4 commits

    • 0b7485d1 - ntp.ntpc: Split _importado() and revise libpaths.
    • 3567b1aa - wscript: refactor builds badly
    • 108f3347 - wscript: expose --enable-pylib option
    • 47dcbd01 - wscript: add/(ab)use --clients-only option 1/x

    Compare with previous version

  • Richard Laager mentioned in merge request !1174 (closed)

    mentioned in merge request !1174 (closed)

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading