Skip to content

Rust bindings (sys crate) - #516

Open
Choochmeque wants to merge 17 commits into
developfrom
rust-bindings-sys
Open

Rust bindings (sys crate)#516
Choochmeque wants to merge 17 commits into
developfrom
rust-bindings-sys

Conversation

@Choochmeque

Copy link
Copy Markdown

Description

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.

@codecov-commenter

codecov-commenter commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.16%. Comparing base (839131c) to head (0376ce5).
⚠️ Report is 64 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #516   +/-   ##
========================================
  Coverage    88.16%   88.16%           
========================================
  Files          854      854           
  Lines        63582    63582           
  Branches     11301    11301           
========================================
  Hits         56056    56056           
  Misses        7526     7526           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joobog joobog added the approved-for-ci Approved to run CI on ECMWF machines label Aug 4, 2026
@joobog
joobog requested a review from Copilot August 4, 2026 11:48

Copilot AI 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.

Pull request overview

Adds an initial Rust workspace to this repository and introduces an eccodes-sys crate that generates raw bindgen-based FFI bindings to the eccodes C API, with CI wiring to run Rust checks.

Changes:

  • Introduces eccodes-sys crate with build.rs that can build eccodes vendored (default) or use a system installation, and generates/validates bindgen output.
  • Adds a Rust workspace (rust/Cargo.toml) plus Cargo configuration for clippy linting.
  • Extends GitHub Actions CI to run Rust fmt/clippy/test for the Rust workspace.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
rust/crates/eccodes-sys/src/lib.rs Adds the eccodes-sys crate entrypoint to include generated bindings and set crate-level lint allowances.
rust/crates/eccodes-sys/Cargo.toml Defines the eccodes-sys package metadata, features, and dependencies for bindgen/build tooling.
rust/crates/eccodes-sys/build.rs Implements vendored/system build logic, resource copying, bindgen generation, and allowlist coverage verification.
rust/Cargo.toml Creates a Rust workspace and centralizes workspace package settings/dependencies.
rust/.cargo/config.toml Configures Rust build/clippy flags for the workspace.
.gitignore Ignores Rust target directories and Cargo.lock files under rust/.
.github/workflows/ci.yml Adds a Rust CI job and wires it into the notify job dependencies.

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

Comment on lines +4 to +7
edition .workspace = true
license .workspace = true
repository .workspace = true
rust-version .workspace = true
Comment on lines +298 to +300
const ECCODES_REPO: &str = "https://github.com/ecmwf/eccodes.git";
const ECCODES_TAG: &str = "2.47.0";

Comment thread rust/.cargo/config.toml
@@ -0,0 +1,12 @@
[build]
jobs = -1
Comment thread .github/workflows/ci.yml
# Run Rust CI (fmt + clippy + test) on the rust/ workspace
ci-rust:
name: ci-rust
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
Comment thread rust/Cargo.toml
Comment on lines +11 to +14
[workspace.dependencies]
bindman-utils = { git = "ssh://git@github.com/ecmwf/bindman.git", rev = "47edf68" }

eckit-sys = { git = "ssh://git@github.com/ecmwf/eckit.git", branch = "rust-bindings", default-features = false }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-for-ci Approved to run CI on ECMWF machines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants