Repository navigation
Add an ABI-v1 C interface - #47
Conversation
|
Thanks xufyan for the PR. This looks good to me. One request for FetchContent consumption: please add an option such as BF_TREE_FFI_BUILD_TESTS to guard the C/C++ test targets, enable_testing(), and add_test() calls. This would let downstream projects to disable dependency tests without disabling its own tests. Standalone builds and upstream CI can keep the FFI tests enabled. EXCLUDE_FROM_ALL alone is insufficient: it excludes the test executables from the default build but leaves BfTreeCAbi and BfTreeCppAbi registered with CTest. |
|
Konstantin V Shvachko (@shvachko) Added With Checked Windows x64 Release: both default ABI tests pass. A fresh standalone OFF configuration registers zero tests. A FetchContent parent with the option OFF builds and passes its own C++ consumer test, with neither dependency test target or registration present. |
aa298d9
into
microsoft:main
Summary
Add an unpublished, caller-buffered
bf-tree-ffipackage.Use the existing native read, scan, insert, delete, and CPR operations.
The only native additions are two read-only
Configgetters:get_cb_min_record_sizeandget_max_key_len.They preserve recovery-limit validation without changing engine operations.
The package preserves ABI-v1 layouts, signatures, statuses, and caller-owned buffers.
It adds versioned capability discovery and bounded scans.
It includes Rust/C/C++ conformance tests, CMake build/install support, source-package filtering, and Windows/Linux CI.
Scope
tree.rs, leaf operations, mini-page operations, range scans, and snapshot code match the upstream base exactly.The native result types, algorithms, and persisted formats remain unchanged.
Native checked-operation APIs and their dedicated tests are outside this contribution.
Interface contracts
openremains explicitly unsupported. Recovery uses a native CPR snapshot.BUFFER_TOO_SMALLleaves caller byte/descriptor buffers unchanged. Scans return complete records within their selected limits.See
bf-tree-ffi/README.mdfor the detailed contract.Local validation
Environment: Windows x64, Rust 1.93.0, MSVC 19.51.
-D warnings.The existing native
spdkconfiguration and dead-code warnings remain unchanged.Release boundaries
This is a review candidate, not a published package or an application migration.
publish = falseis intentional.The adjacent native source includes two configuration getters that its
0.5.7version number alone does not identify.Publication requires approved, compatible native and FFI versions or another immutable source mechanism.
Windows ARM64 runtime, controlled performance, and broader durability qualification remain open.
The added CI job covers Windows x64 and Linux x64; it does not replace Windows ARM64 qualification.
Application adoption also requires snapshot compatibility and rollback from newly produced data.
An earlier unseeded Windows native-suite run stalled in
stateful_operations_match_ordered_model::case_2_std_io.Seeded comparisons did not reproduce it.
Its cause remains unproven, and this revision does not claim a fix.