Skip to content

abi: enforce header/Rust parity, symbol visibility, and runtime version query #99

Closed

Description

@Xuanwo

Harden the C ABI contract for both C/C++ and dynamic-loader consumers (such as pure-Go lancedb-go via dlopen):

  • Header/Rust parity: include/lancedb.h (2,200+ lines) is currently kept in sync with src/*.rs manually. Add automated verification (e.g., cbindgen generation or diff check in CI) to guarantee extern "C" Rust signatures match include/lancedb.h.
  • Symbol visibility: Restrict exported shared-library symbols on Linux (version script), macOS (exported symbols list), and Windows (.def / exports) so only public lancedb_* symbols are exported.
  • Version introspection: Add compile-time version macros in include/lancedb.h and a runtime version query function returning the built LANCEDB_VERSION string so consumers can verify the loaded library version.
  • FFI unwind boundary: Audit extern "C" entry points to ensure Rust panics cannot unwind across the FFI boundary.

Activity

  1. added
    enhancement
    on Nov 21, 2026
  2. Xuanwo commented on Nov 22, 2026

    @Xuanwo
    MemberAuthor

    The four ABI checks in this issue are complete. #115 checks the C header against the Rust declarations in CI, #120 adds the header version macros and lancedb_version(), and #162 limits the Linux, macOS, and native MSVC shared libraries to the functions declared in the public header.

    The source audit found that all 240 public Rust functions at c4a2313 use the non-unwinding extern "C" ABI. If a Rust panic reaches that boundary, Rust aborts the process before it can unwind through C frames. Runtime error handling and recovery remain tracked in #76.

    Rust ABI unwinding rules

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions