Skip to content

Rust bindings v1 - #284

Open
Choochmeque wants to merge 91 commits into
developfrom
rust-bindings-v1
Open

Rust bindings v1#284
Choochmeque wants to merge 91 commits into
developfrom
rust-bindings-v1

Conversation

@Choochmeque

@Choochmeque Choochmeque commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Description

Use eckit high-level crate

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

🌈🌦️📖🚧 Documentation FDB 🚧📖🌦️🌈
https://sites.ecmwf.int/docs/fdb/pull-requests/PR-284

…xample, because it should be reusable-action)
@codecov-commenter

codecov-commenter commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.05%. Comparing base (9319a5c) to head (7076035).
⚠️ Report is 58 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #284      +/-   ##
===========================================
- Coverage    71.15%   71.05%   -0.11%     
===========================================
  Files          370      370              
  Lines        23455    23455              
  Branches      2463     2463              
===========================================
- Hits         16690    16666      -24     
- Misses        6765     6789      +24     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Rust FDB bindings to use the higher-level eckit/metkit Rust crates directly (instead of a custom Request/DataReader layer), and adapts downstream tools/tests/examples to the new API shape.

Changes:

  • Replace fdb::Request with metkit::MarsRequest and migrate call sites accordingly.
  • Replace the custom DataReader with eckit::DataHandle + open_for_read() for streaming reads.
  • Introduce UserConfig and new C++ bridge plumbing (including MessageArchiver) and update fdb-hammer to match.

Reviewed changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
rust/Cargo.toml Switch workspace deps to local-path eckit/metkit/bindman sources (currently non-reproducible).
rust/tools/fdb-hammer/src/main.rs Migrate hammer to metkit::CodesHandle, metkit::MarsRequest, and new Fdb::open signature.
rust/tools/fdb-hammer/README.md Update runtime instructions for hammer (RPATH/env-var guidance text).
rust/tools/fdb-hammer/Cargo.toml Add eckit/metkit deps; add build-dep for rpath helper.
rust/tools/fdb-hammer/build.rs Emit RPATH entries for runtime shared-library discovery.
rust/crates/fdb/src/lib.rs Public API re-exports updated: remove Request/DataReader, add UserConfig/MessageArchiver.
rust/crates/fdb/src/handle.rs Core API updated to accept metkit::MarsRequest and return eckit::DataHandle; add MessageArchiver.
rust/crates/fdb/src/options.rs Add UserConfig overlay config type and conversion into eckit::Config.
rust/crates/fdb/src/error.rs Simplify error mapping to wrap eckit::Error directly.
rust/crates/fdb/src/request.rs Remove custom Request wrapper implementation.
rust/crates/fdb/src/datareader.rs Remove custom DataReader wrapper implementation.
rust/crates/fdb/README.md Document downstream binary RPATH handling via bindman_utils::emit_rpaths().
rust/crates/fdb/build.rs Change build-script behavior to re-export dependency root metadata.
rust/crates/fdb/Cargo.toml Update crate metadata/deps to include eckit/metkit, adjust links.
rust/crates/fdb/examples/fdb_retrieve.rs Update example to parse requests via metkit and read via DataHandle.
rust/crates/fdb/examples/fdb_read.rs Update example to parse requests via metkit and stream via DataHandle.
rust/crates/fdb/examples/fdb_list.rs Update example to parse requests via metkit and call Fdb::list with MarsRequest.
rust/crates/fdb/examples/fdb_axes.rs Update example to parse requests via metkit and call Fdb::axes with MarsRequest.
rust/crates/fdb/examples/fdb_archive.rs Update example to open config via eckit::Config::from_path.
rust/crates/fdb/benches/fdb_bench.rs Update benchmarks to build MarsRequest and initialise eckit where needed.
rust/crates/fdb/tests/fdb_integration.rs Update integration tests to use eckit::Config, MarsRequest, and DataHandle IO.
rust/crates/fdb/tests/fdb_async.rs Update async tests to build MarsRequest from Key and read via DataHandle.
rust/crates/fdb/tests/fdb_thread_safety.rs Update thread-safety tests to new request type and config handling (currently non-hermetic).
rust/crates/fdb-sys/src/lib.rs Rework CXX interface: take MarsRequestWrapper and ConfigWrapper; return DataHandleWrapper.
rust/crates/fdb-sys/cpp/fdb_bridge.h Update bridge header to include metkit/eckit wrapper headers; add MessageArchiver wrappers.
rust/crates/fdb-sys/cpp/fdb_bridge.cpp Implement new bridge functions for list/retrieve/axes/etc using MarsRequestWrapper.
rust/crates/fdb-sys/build.rs Generate exception bridge; update include/link metadata and vendored/system build logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rust/Cargo.toml Outdated
Comment thread rust/Cargo.toml Outdated
Comment thread rust/crates/fdb/src/handle.rs
Comment thread rust/crates/fdb/src/lib.rs Outdated
Comment thread rust/tools/fdb-hammer/src/main.rs
Comment thread rust/crates/fdb/tests/fdb_thread_safety.rs
Comment thread rust/crates/fdb/tests/fdb_thread_safety.rs
Comment thread rust/crates/fdb/tests/fdb_thread_safety.rs
Comment thread rust/crates/fdb/tests/fdb_thread_safety.rs
Comment thread rust/crates/fdb/tests/fdb_thread_safety.rs
@Choochmeque
Choochmeque marked this pull request as ready for review June 23, 2026 23:52
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