Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9ed3671
Initial commit of -sys crate
Choochmeque Apr 30, 2026
9a25e98
Apply clang format
Choochmeque Apr 30, 2026
b6c0481
Refactor exception handling integration for downstream `-sys` crates
Choochmeque May 12, 2026
77834c3
Fix include order in eckit_bridge.cpp
Choochmeque May 12, 2026
1fcd143
Enhance logging by adding target parameter to RustLogTarget and rust_…
Choochmeque Jun 5, 2026
f5b4ea7
Merge branch 'develop' into rust-bindings
Choochmeque Jun 5, 2026
bf67146
Add RustReaderHandle to forward read/seek calls from Rust to C++ Data…
Choochmeque Jun 5, 2026
18d3926
Update documentation for `ReadSeek` trait and `make_reader_box` function
Choochmeque Jun 5, 2026
35d7530
Remove branch specification for bindman dependencies in Cargo.toml
Choochmeque Jun 10, 2026
56192cc
Merge branch 'develop' into rust-bindings
Choochmeque Jun 10, 2026
d65a182
Fix formatting issues in EasyCURL and test_easycurl
Choochmeque Jun 11, 2026
cc845f0
Remove unused RustLibrary class and related library registration code
Choochmeque Jun 11, 2026
de291ac
Move cargo configuration to rust folder
Choochmeque Jun 11, 2026
78a5e90
Move C++ classes to dedicated header files
Choochmeque Jun 12, 2026
0ed608e
Update README to clarify Cargo build features for eckit-sys crate
Choochmeque Jun 12, 2026
f1490c5
Refactor initialization of RustMain to use maybe_unused attribute
Choochmeque Jun 12, 2026
f74decb
Refactor StreamWrapper to use virtual stream() method for I/O operations
Choochmeque Jun 12, 2026
e3d7d9d
Refactor RustLogTarget to simplify log target creation and handling
Choochmeque Jun 12, 2026
cd4de73
Refactor DataHandleWrapper methods to use static factory functions
Choochmeque Jun 12, 2026
d61d289
Split C++ implementation too
Choochmeque Jun 12, 2026
51584a5
Pin bindman revision
Choochmeque Jun 12, 2026
fc54544
Include application name in RustLogTarget constructors
Choochmeque Jun 15, 2026
4b7fd27
Fix formatting
Choochmeque Jun 15, 2026
6428f27
Add platform-specific program name retrieval in log.cpp
Choochmeque Jun 15, 2026
0e87182
Merge branch 'develop' into rust-bindings
Choochmeque Jun 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/ci-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: rust

on:
push:
branches:
- 'master'
- 'develop'
- 'rust-bindings'
tags-ignore:
- '**'
paths:
- 'rust/**'
- '.github/workflows/ci-rust.yml'

pull_request:
paths:
- 'rust/**'
- '.github/workflows/ci-rust.yml'

workflow_dispatch: ~

env:
CARGO_TERM_COLOR: always
CARGO_NET_GIT_FETCH_WITH_CLI: "true"

jobs:
fmt:
name: fmt
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Format check
run: cargo fmt --check

clippy:
name: clippy
if: ${{ !github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4

- name: Configure git for private repos
run: git config --global url."https://x-access-token:${{ secrets.GH_REPO_READ_TOKEN }}@github.com/".insteadOf "ssh://git@github.com/"

- uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Clippy
run: cargo clippy --features vendored --all-targets -- -D warnings

test:
name: test
if: ${{ !github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4

- name: Configure git for private repos
run: git config --global url."https://x-access-token:${{ secrets.GH_REPO_READ_TOKEN }}@github.com/".insteadOf "ssh://git@github.com/"

- uses: dtolnay/rust-toolchain@stable

- name: Test
run: cargo test --features vendored
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ build/
tests/geo/eckit_geo_cache
_build
*.ccls-cache

# Rust
rust/target/
rust/Cargo.lock
15 changes: 15 additions & 0 deletions rust/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[build]
jobs = -1

[target.'cfg(all())']
rustflags = [
"-Wclippy::all",
"-Wclippy::pedantic",
"-Wclippy::nursery",
"-Wclippy::unwrap_used",
"-Aclippy::module_name_repetitions",
"-Aclippy::missing_errors_doc",
]

[net]
git-fetch-with-cli = true
28 changes: 28 additions & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[workspace]
resolver = "2"
members = ["crates/eckit-sys"]

[workspace.package]
edition = "2024"
license = "Apache-2.0"
repository = "https://github.com/ecmwf/eckit"
rust-version = "1.90"
readme = "README.md"
keywords = ["ecmwf", "weather", "meteorology", "geo"]
categories = ["science"]

[workspace.dependencies]
# Internal
eckit-sys = { path = "crates/eckit-sys" }

# Build tools
bindman = { git = "ssh://git@github.com/ecmwf/bindman.git", rev = "47edf68" }
bindman-build = { git = "ssh://git@github.com/ecmwf/bindman.git", rev = "47edf68" }
bindman-utils = { git = "ssh://git@github.com/ecmwf/bindman.git", rev = "47edf68" }

# External
cxx = "1.0"
cxx-build = "1.0"
log = "0.4"
thiserror = "2"
tempfile = "3"
88 changes: 88 additions & 0 deletions rust/crates/eckit-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
[package]
name = "eckit-sys"
version = "2.0.7"
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
readme.workspace = true
keywords.workspace = true
categories.workspace = true
description = "FFI bindings to ECMWF eckit C++ library"
links = "eckit_sys"
build = "build.rs"

[features]
# Defaults: core features that don't require external libraries
default = ["vendored", "eckit-codec", "eckit-spec", "eckit-geo", "unicode", "aio"]

# Build strategy (mutually exclusive)
vendored = []
system = []

# Core eckit libraries (CMake default: ON)
eckit-codec = ["eckit-spec"] # eckit::codec encoding/decoding library (requires eckit-spec)
eckit-spec = [] # eckit::spec metadata library
eckit-geo = [] # eckit::geo geometry library
eckit-sql = [] # eckit::sql SQL engine (required by odc)

# MPI support (CMake default: ON, requires MPI)
mpi = [] # Use system MPI libraries

# Compression codecs (CMake default: OFF, require external libs)
bzip2 = [] # BZip2 support for compression
snappy = [] # Snappy support for compression
lz4 = [] # LZ4 support for compression
aec = [] # AEC support for compression
zip = [] # ZIP support for compression

# Hashing (CMake default: OFF)
xxhash = [] # xxHash support for hashing

# Linear algebra (CMake default: OFF, require external libs)
eigen = [] # Eigen linear algebra library
lapack = [] # Linear Algebra PACKage
mkl = [] # MKL linear algebra library
omp = [] # OpenMP linear algebra backend

# Network (CMake default: OFF, require external libs)
curl = [] # Curl library for transfering data with URLs
ssl = [] # OpenSSL support

# Other features
unicode = [] # Unicode support (CMake default: ON)
aio = [] # Async IO support (CMake default: ON)
proj = [] # PROJ-based projections support
rados = [] # Ceph/Rados storage support
jemalloc = [] # Link against jemalloc memory allocator
rsync = [] # librsync implementation of the rsync algorithm

# GPU support (CMake default: OFF)
cuda = [] # CUDA GPU linear algebra operations
hip = [] # HIP GPU linear algebra operations

# Geo sub-features (CMake default: OFF, except geo-area-shapefile)
geo-codec-grids = ["eckit-codec", "lz4", "eckit-geo"] # ORCA/FESOM/ICON grid types (requires codec + LZ4)
geo-caching = [] # eckit::geo default caching behaviour
geo-bitreproducible = [] # eckit::geo bit reproducibility tests
geo-projection-proj-default = [] # eckit::geo default to PROJ-based projections
geo-area-shapefile = [] # Shapefile support (CMake default: ON)

# Advanced (CMake default: OFF)
convex-hull = [] # eckit::maths convex hull/Delaunay triangulation

# Experimental (CMake default: OFF)
experimental = [] # Experimental features
sandbox = [] # Sandbox playground for prototyping

[dependencies]
bindman.workspace = true
cxx.workspace = true
log.workspace = true

[build-dependencies]
bindman-utils.workspace = true
bindman-build.workspace = true
cxx-build.workspace = true

[package.metadata.docs.rs]
83 changes: 83 additions & 0 deletions rust/crates/eckit-sys/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# eckit-sys

Low-level Rust bindings to ECMWF's [eckit](https://github.com/ecmwf/eckit) C++
library.

This crate provides raw FFI bindings using [cxx](https://cxx.rs/). For a safe,
ergonomic API, use the higher-level `eckit` crate (forthcoming).

## Cargo build features

These flags control what the underlying C++ eckit library is compiled with.

### Build strategy (mutually exclusive)

- `vendored` (default) - Clone and build eckit (and ecbuild) from source.
- `system` - Link against a system-installed eckit, located via CMake
`find_package(eckit)`. Honours `ECKIT_DIR` and `CMAKE_PREFIX_PATH`.

### Core eckit libraries (enabled by default)

- `eckit-codec` - `eckit::codec` encoding/decoding library (implies `eckit-spec`).
- `eckit-spec` - `eckit::spec` metadata library.
- `eckit-geo` - `eckit::geo` geometry library.
- `unicode` - Unicode support.
- `aio` - Async I/O support.

### Optional eckit libraries

- `eckit-sql` - `eckit::sql` SQL engine (required by `odc`).

### MPI

- `mpi` - Use system MPI libraries.

### Compression codecs (off by default; require external libraries)

- `bzip2`, `snappy`, `lz4`, `aec`, `zip`

### Hashing (off by default)

- `xxhash`

### Linear algebra (off by default; require external libraries)

- `eigen`, `lapack`, `mkl`, `omp`

### Networking (off by default; require external libraries)

- `curl` - libcurl support for `eckit::URLHandle`.
- `ssl` - OpenSSL support.

### GPU (off by default)

- `cuda`, `hip`

### Geo sub-features

- `geo-codec-grids` - ORCA/FESOM/ICON grid types (implies `eckit-codec`,
`eckit-geo`, `lz4`).
- `geo-caching` - Default eckit::geo caching behaviour.
- `geo-bitreproducible` - Bit-reproducibility tests.
- `geo-projection-proj-default` - Default to PROJ-based projections.
- `geo-area-shapefile` - Shapefile support.

### Other (off by default)

- `proj` - PROJ-based projection support.
- `rados` - Ceph/RADOS storage support.
- `jemalloc` - Link against jemalloc.
- `rsync` - librsync.
- `convex-hull` - `eckit::maths` convex hull / Delaunay triangulation.
- `experimental` - Experimental upstream features.
- `sandbox` - Sandbox builds.

## Environment variables

- `ECKIT_DIR` - Install prefix of an eckit build, used by `system` mode.
- `CMAKE_PREFIX_PATH` - Additional CMake search paths.
- `DOCS_RS` - When set, the build script becomes a no-op (for docs.rs).

## License

Apache-2.0
Loading
Loading