Skip to content

Rust bindings v1 - #284

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

Rust bindings v1#284
Choochmeque wants to merge 105 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)
@Choochmeque
Choochmeque marked this pull request as ready for review June 23, 2026 23:52

@tbkr tbkr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I looked at this PR and wonder in which state it is. Would it be possible to give me documentation/setup instructions for testing this local?

Also a rebase would be nice (although I appreciate that at the point in time when the PR was opened, this was up-to-date).

Have a look at the pinned versions (and the lack of them by pointing to develop) and update those, as well.

My overall comment would be: Which level of user-interaction are we targeting here? If this is on the C++ level we should keep the functions/objects as close as possible to the C++-API. If we are closer to the Python side, we should streamline things with the already existing PyFDB interface.

Happy to have a chat, if necessary.

Comment thread rust/Cargo.toml
eckit-sys = { git = "ssh://git@github.com/ecmwf/rust-wrappers-playground.git", default-features = false }
metkit-sys = { git = "ssh://git@github.com/ecmwf/rust-wrappers-playground.git", default-features = false }
eccodes-sys = { git = "ssh://git@github.com/ecmwf/rust-wrappers-playground.git", default-features = false }
eckit-sys = { git = "ssh://git@github.com/ecmwf/eckit.git", branch = "develop", default-features = false }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should probably introduce a reproducable build, which pins certain fixed versions. Depending on develop isn't the best idea.

Comment thread .github/workflows/ci.yml Outdated
with:
manifest-path: rust/Cargo.toml
features: --features fdb-sys/vendored
run-doc: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Docs should be build in the cicd, as well to see potential breakage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in bba8cf5

Comment thread rust/crates/fdb-sys/build.rs Outdated
.include(&eccodes_include)
.include(crate_dir.join("cpp"))
.include(&out_dir) // for fdb_exceptions.h (generated)
.flag_if_supported("-std=c++17")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use .std("c++17")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 9d74e64

Comment thread rust/crates/fdb-sys/build.rs Outdated
.include(format!("{eccodes_root}/include"))
.include(crate_dir.join("cpp"))
.include(&out_dir) // for fdb_exceptions.h (generated)
.flag_if_supported("-std=c++17")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

again, .std

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 9d74e64

/// Generic error from the FDB C++ library.
#[error("fdb error: {0}")]
Fdb(String),
/// Error from eckit/metkit C++ libraries.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why did those disappear?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The old enum was a hand-maintained copy of eckit's exception hierarchy with String payloads. That now comes from eckit::Error, generated at build time from eckit/exception/Exceptions.h, so fdb wraps it as Error::Eckit instead of duplicating it - same variants, but they can't drift from the headers.

@Choochmeque

Copy link
Copy Markdown
Contributor Author

Hi @tbkr,

Happy to have a chat, if necessary.

sure, let's discuss it in teams.

@Choochmeque
Choochmeque requested a review from tbkr August 26, 2026 16:42
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.

4 participants