Gunnar

mikronova/openzl-sys-rs

openzl-sys-rs

Low-level Rust bindings to OpenZL, linked statically.

The C sources are vendored

Building this crate needs a C compiler and nothing else:

OpenZL's C sources, plus the exact zstd 1.5.7 and lz4 1.10.0 releases OpenZL pins, live under openzl/. build.rs compiles them with the cc crate, reproducing the flags OpenZL's own CMake used. See openzl/VENDOR.md for provenance, upstream tarball hashes, licences and the exact build configuration.

Up to and including 0.2.0 this crate downloaded a pinned facebook/openzl tarball with curl at build time and drove cmake, which in turn fetched zstd and lz4. That made the crate unbuildable offline, in a sandbox, or anywhere a build is not allowed to reach the network. 0.3.0 removes all of it. The compiled library is unchanged: same OpenZL commit, same zstd, same lz4, same compile flags, and compressed output is byte-for-byte identical to 0.2.0's.

Which OpenZL is inside

The wrapper's version is not OpenZL's version. From 0.4.0 the crate version names the bundled release as build metadata: 0.4.0+openzl.0.3.0.

openzl-sys-rsOpenZLWrites frame formatReads frame formats
0.1.x, 0.2.x, 0.3.x0.2.1 (commit ca28e4bc)25 by default8..=25
0.4.x0.3.0 (tag v0.3.0)27 by default8..=27

OpenZL 0.3.0 writes format 27 unless told otherwise, and a 0.3.x-wrapper reader cannot decode that. A writer whose output must stay readable by older readers sets ZL_CParam_formatVersion to 25 explicitly. 0.4.0's bindings follow OpenZL 0.3.0's API renames (ZL_MaterializerDesc2 → ZL_MaterializerDesc, registerBruteForceSelectorGraph → buildBruteForceSelectorGraph); see openzl/VENDOR.md.

Using a pre-built library instead

Set OPENZL_SYS_LIB_DIR to a directory containing libopenzl.a, libzstd.a and liblz4.a to link those and skip compiling the vendored tree. The build script says so on stderr, and fails loudly if any of the three is missing.

Licence

The crate is BSD-3-Clause. It redistributes vendored C sources under BSD-3-Clause (OpenZL; zstd, whose BSD option is elected) and BSD-2-Clause (lz4's lib/). Package licence expression: BSD-3-Clause AND BSD-2-Clause.

Files

openzl/
src/
tests/
.gitignore
Cargo.lock
Cargo.toml
LICENSE
README.md
build.rs
wrapper.h

The list is cut short here. Clone the repository for every file.

Newest commits

db0ae2eabc9fMerge fix/small-4-2026-10-25 into main: repository = names the real home, with N7's guard (A28 N7-left)2026-10-25
c81837113b93GREEN: repository = https://git.gunnar.rs/mikronova/openzl-sys-rs, the crate's real home (A28 N7-left; tests 7/0)2026-10-25
eb8f7e2b7047TEST: every manifest names this repository's real home, and no file addresses our repositories on the old forge (A28 N7-left; RED: repository is https://gunnar.rs/repo/mikronova/openzl-sys-rs)2026-10-25
9b2ba19b0a650.4.1+openzl.0.3.0: repository is gunnar.rs (moved from Codeberg)2026-10-15
fc06594a2e00publish prep: authors -> Ignalina ApS; copyright line names the company2026-10-04