Skip to content

No version export: bindings cannot detect library/ABI skew at runtime — add nodedb_version #13

Description

@emanzx

Summary

The cdylib exports no version symbol, so a binding cannot detect at runtime which library build it is talking to. Requesting a nodedb_version export.

Checked on origin/main @ ee9ccdd: no version export exists in nodedb-lite-ffi (the crate version is used internally for the sync client_version string, but is not exposed to callers).

Why it matters

Bindings load the library by name (-lnodedb_lite_ffi / dlopen). When the ABI grows or behavior changes, a stale .so on the library path fails late and confusingly: missing symbols abort at first call, and behavior changes fail silently. Our binding currently pins the build by comparing sha256sum of the .so against a recorded hash — workable, but it can only say "different", not "which one", and it breaks on every rebuild even when nothing relevant changed.

Suggested change

// Static string, no allocation, safe to call before any open.
const char *nodedb_version(void);   // e.g. "0.5.0+ee9ccdd"

Compile-time from CARGO_PKG_VERSION (plus git short-sha if available at build time). A companion integer form (uint32_t nodedb_abi_version(void)) bumped on breaking FFI changes would let bindings fail fast with a clear message instead of dying on a missing symbol.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P3Backlog / somedaytype:choreBuild, CI, refactor, or maintenance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions