alef 0.85.21

Opinionated polyglot binding generator for Rust libraries
Documentation

[package]
name = "alef"
version = "0.85.21"
edition = "2024"
rust-version = "1.89"
license = "MIT"
repository = "https://github.com/xberg-io/alef"
homepage = "https://github.com/xberg-io/alef"
description = "Opinionated polyglot binding generator for Rust libraries"
keywords = ["codegen", "bindings", "ffi", "polyglot", "pyo3"]
categories = ["development-tools::ffi", "development-tools::build-utils"]
readme = "README.md"

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/alef-{ target }{ archive-suffix }"
bin-dir = "alef-{ target }/{ bin }{ binary-ext }"
pkg-fmt = "tgz"

[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-fmt = "zip"

[package.metadata.cargo-machete]
ignored = ["tracing"]
[lib]
name = "alef"
path = "src/lib.rs"

[[bin]]
name = "alef"
path = "src/main.rs"

[features]
dylib-loader = ["dep:libloading"]

[dependencies]
ahash = "0.8"
anyhow = "1"
base64 = "0.23"
blake3 = "1"
chrono = { version = "0.4", default-features = false, features = ["clock"] }
clap = { version = "4", features = ["derive"] }
convert_case = "0.12"
glob = "0.3"
heck = "0.5"
# Exactly pinned, not caret: `codegen::coordinates` publishes the pinned Unicode version these
# two tables carry as part of the NuGet package-ID contract, and a caret bump would move that
# version silently. See `tests/unicode_dependency_pins.rs`. ~keep
icu_casemap = "=2.3.0"
jsonschema = { version = "0.56", default-features = false, features = ["resolve-file"] }
libloading = { version = "0.9", optional = true }
minijinja = "2"
quote = "1"
rayon = "1"
regex = "1"
schemars = "1"
semver = "1"
serde = { version = "1", features = ["derive"] }
serde-saphyr = { version = "1.2", default-features = false, features = ["deserialize"] }
serde_json = "1"
sha2 = "0.11"
similar = "3"
syn = { version = "3", features = ["full", "parsing", "visit"] }
tempfile = "3"
thiserror = "2"
toml = "1.1"
toml_edit = "0.25"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
unicode-general-category = "=1.1.0"
ureq = { version = "3", features = ["json"] }
walkdir = "2"
which = "8"
zip = { version = "8", default-features = false, features = ["deflate"] }

# `process::termination` puts every deadline-bounded child in its own process group and then has to
# forward `SIGINT`/`SIGTERM`/`SIGHUP` to those groups itself, because a detached group never
# receives the terminal's own signals. `kill(2)` from a signal handler is the only async-signal-safe
# way to do that, and std exposes neither it nor signal installation. ~keep
[target.'cfg(unix)'.dependencies]
libc = "0.2"

# `process::job` is the Windows half of the same problem `libc` solves above: Windows has no
# process group to signal, so a subprocess tree is killed by putting the child in a job object and
# calling `TerminateJobObject`. std exposes neither, and `Child::kill` reaches the direct child
# only. ~keep
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = [
  "Win32_Foundation",
  "Win32_Security",
  "Win32_System_JobObjects",
  "Win32_System_Threading",
] }

[dev-dependencies]
# Pinned to the same minor line generated FFI crates depend on (see e.g.
# `crates/*-ffi/Cargo.toml` in consumer repos), so the regression test that
# feeds alef's own generated `cbindgen.toml` through a real cbindgen run
# exercises the same `[defines]`-matching behavior consumers hit. ~keep
cbindgen = "0.29"
criterion = { version = "0.8", features = ["html_reports"] }
insta = { version = "1.48", features = ["redactions"] }
tracing-test = "0.2"

# Diagnostics must flow through `tracing`; genuine command results through the sanctioned
# `bin_cli::output` helper. Raw print macros are forbidden on production code paths; the few
# legitimate stdout sites (the output helper, report modules, e2e harness, build.rs, tests)
# carry a narrow `#[allow]`. ~keep
[lints.clippy]
print_stdout = "deny"
print_stderr = "deny"
dbg_macro = "deny"

[[bench]]
name = "backends_dart_emit"
harness = false

[[bench]]
name = "backends_gleam_emit"
harness = false

[[bench]]
name = "backends_kotlin_emit"
harness = false

[[bench]]
name = "backends_swift_emit"
harness = false

[[bench]]
name = "backends_zig_emit"
harness = false