Rust bindings (sys crate) - #516
Open
Choochmeque wants to merge 17 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
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-syscrate withbuild.rsthat 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"; | ||
|
|
| @@ -0,0 +1,12 @@ | |||
| [build] | |||
| jobs = -1 | |||
| # 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 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 } |
…uild.rs for runtime library support
…handling in build scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Contributor Declaration
By opening this pull request, I affirm the following: