Skip to content

ABI stability: exported FFI symbol signatures must not change — add versioned exports instead #19

Description

@EnRaiha

Summary

Exported FFI symbol signatures freeze at the first tagged release. Before that tag, change the signature in place and regenerate include/nodedb_lite.h. After that tag, add a separately named export; the legacy entry point delegates and discards the new output.

Context

PR #15 initially added an out_edge_id parameter to the existing nodedb_graph_insert_edge export. For a shipped binary this is an ABI break: a caller compiled against the old declaration still resolves the same symbol, but the callee reads a sixth register/stack argument the old caller never initialized — if it happens to be non-null, write_c_string can dereference an arbitrary address.

Nothing has shipped yet (no releases, no tags; the 0.1.0 heading in CHANGELOG.md is unreleased), so no binary anywhere was compiled against a five-argument nodedb_graph_insert_edge. Per the pre-release rule, #15 was merged with a single six-argument nodedb_graph_insert_edge (f9c520c) — no legacy alias for zero existing callers.

Follow-ups

  • CONTRIBUTING.md paragraph stating the freeze point explicitly (first tagged release).
  • CI check: diff nm -D --defined-only libnodedb_lite_ffi.so | sort against the previous release tag. No-op until the first tag exists, which is the correct behaviour.
  • Bump nodedb_abi_version on any signature change so bindings fail fast.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions