Skip to content

Import core Rust bindings and C ABI simulator support - #14187

Draft
tclinkenbeard-oai wants to merge 11 commits into
apple:mainfrom
tclinkenbeard-oai:dev/tclinkenbeard/migrate-rust-bindings
Draft

tclinkenbeard-oai wants to merge 11 commits into
apple:mainfrom
tclinkenbeard-oai:dev/tclinkenbeard/migrate-rust-bindings

Conversation

@tclinkenbeard-oai

@tclinkenbeard-oai tclinkenbeard-oai commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Import the core Rust bindings from the foundationdb-rs snapshot recorded in bindings/rust/UPSTREAM.md, preserving historical client headers/options, attribution, and the MIT/Apache-2.0 licenses. The workspace contains the client, C bindings, option generator, tuple, macros, shared bindingtester, and an optional C-ABI simulator adapter.

BUILD_RUST_BINDING=ON builds against the in-tree C client, generated headers, and canonical fdb.options. Rust participates in the shared scripted and randomized binding tests, including API and directory comparisons with Python, subject to its advertised capabilities. Scripted tests select the newest common supported API; randomized tests sample supported versions. It currently supports client APIs through 740; API 800/native CDC wrappers and directory snapshot operations are outside this import. Historical client snapshots remain available for standalone Cargo builds.

The client retains native transactions/retries, tuple/subspace/directory support, mapped ranges, and focused API examples. Native on_error handles backoff and retry limits; wrapped errors retain their type and commit uncertainty remains cumulative. Application recipes, accounting/budget/reporting, custom retry-policy/hooks, profiling, Timekeeper utilities, and their application examples are excluded.

Alongside BUILD_RUST_BINDING=ON, BUILD_RUST_SIMULATION=ON enables minimal simulator support using the canonical CWorkload.h, with noop, shared-future, and atomic examples. The adapter retains owner-thread scheduling, cancellation, borrowed database ownership, context lifetime guards, and callback metric lifetimes. The legacy C++ bridge/private headers, tracing integration crate, Nix environment, and old Docker/campaign tooling are excluded. The shared C client exposes its selected API pair so compatible Rust libraries can initialize safely in one process without taking ownership of the simulator network.

Validation on Linux with Rust 1.85.1:

  • CMake Release builds of the core client/tester, simulator examples/tests, and integration targets passed. Core-only configuration registers no simulator tests.
  • All 14 Rust CTests passed: core/simulator units, compile-fail ownership/lifetime checks, the Loom wake-order model, disposable-cluster integration, shared bindingtester, transaction error ownership, and shared-library API selection.
  • All seven workspace crates/all targets compile with current headers. Formatting, Clippy and documentation with warnings denied, and all ten historical client API checks passed.
  • Simulator noop (seed 14187) and shared (seed 14188) passed with buggify disabled.

The draft retains one unresolved simulator runtime limitation: atomic still crashes at seed 14189 with buggify disabled. Debugger replay stops in fdb_database_create_transaction after an awaited commit, matching the previously reported failure. Its fault workloads and correctness checks remain intact. This trim does not claim complete simulator runtime compatibility. macOS runtime behavior and native distribution packaging/publishing remain unvalidated or follow-up work.

Source: https://github.com/foundationdb-rs/foundationdb-rs, upstream main snapshot dated September 25, 2026. Preserve the upstream crates, tests, examples, history logs, and dual MIT/Apache-2.0 licenses. Omit repository-specific hosted automation and agent configuration.
Add opt-in CMake targets using the in-tree C client and generated headers/options, register and package the Rust binding tester, add Cargo checks, and document the imported API compatibility and release boundaries.
@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@tclinkenbeard-oai

Copy link
Copy Markdown
Collaborator Author

FYI @PierreZ I can't add you as a reviewer, but this is the PR we discussed a few months ago

@PierreZ

PierreZ commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Yeah I remember!
I'm the main and solo maintainer of the rust bindings, and I think it would benefit from landing here.

I'm not sure how the contribution would be with a community-based bindings. Especially when I personally added some experimental stuff in it!

Any thoughts?

@tclinkenbeard-oai tclinkenbeard-oai changed the title Import Rust bindings into bindings/rust Import core Rust bindings and C ABI simulator support Oct 2, 2026
@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-ide on Linux RHEL 9

  • Commit ID: 916dc51
  • Duration 0:23:18
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-arm on Linux RHEL 9

  • Commit ID: 916dc51
  • Duration 0:50:03
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS 14.x

  • Commit ID: 916dc51
  • Duration 0:56:40
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang on Linux RHEL 9

  • Commit ID: 916dc51
  • Duration 1:02:37
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux RHEL 9

  • Commit ID: 916dc51
  • Duration 1:06:18
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-cluster-tests on Linux RHEL 9

  • Commit ID: 916dc51
  • Duration 1:47:43
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS 14.x

  • Commit ID: 916dc51
  • Duration 2:09:27
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

This comment has been minimized.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants