Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/gunnar

crates/gunnar-common/Cargo.toml

[package]
name = "gunnar-common"
description = "Shared command line, logging, and build identity for the gunnar binaries"
readme = "README.md"
# 2.0.0 (2026-10-26, lane GUN-INSTALL / G-BOTH, the R5C publish): master differs from crates.io, so
# it gets its own version; a major: cargo-semver-checks names breaking changes against crates.io 1.5.0.
version = "4.0.0"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
# On the `cargo install gunnar` chain (owner order 2026-10-22).
publish = true
authors.workspace = true
repository.workspace = true
# Stamps GUNNAR_BUILD_REF / GUNNAR_BUILD_DATE_PART, which `cli.rs`'s `--version`
# string reads. The build-thing RECEIPT is NOT written here — that stays in each
# binary crate's own `build.rs`, next to the `include!` that reads it back.
build = "build.rs"

[lib]
name = "gunnar_common"
path = "src/lib.rs"

[features]
# The same five halves gunnar-cli gates its `Command` variants with, so
# `--no-default-features --features server` compiles a CLI that genuinely has no
# `clone` in it — and pulls none of the client's crates. gunnar-cli forwards its
# own features into these, so the appliance graph the guard measures is
# unchanged.
server = ["dep:gunnar-core", "dep:gunnar-wire", "dep:tokio"]
client = ["dep:gunnar-client", "gunnar-client/porcelain"]
control = ["dep:gunnar-proto"]
http = []
systemd = []
# **The metered appliance's half of the command line** — today exactly one
# argument, `ServeArgs::billing_url`.
#
# It exists because a cargo feature is the only thing that removes a flag from
# `--help`, and gunnar is the OPEN product: it reports `Usage`, receives a
# signed `Entitlement`, and takes no money. `gunnar-server/metered` is the one
# thing that turns this on (it forwards here the way it already forwards to
# `gunnar-core/metered`), so the open binary and the metered binary disagree
# about their own surface rather than about a runtime check.
#
# Note it does NOT gate `--monetize-pubkey`: the open build must still parse
# that flag to refuse it BY NAME at boot. See the comment on `billing_url` in
# `src/cli.rs` for the whole asymmetry.
metered = []
# The usage share's two serve flags (`--admit-limit`, `--admit-window-days`),
# which exist only in a build whose gate has the share (gunnar-ssh/admit-share).
admit-share = []
# fd 2 becomes a pipe whose lines are said through tracing (gunnar-front: monetize-server's eprintln! reaches the boot log).
stderr-capture = ["dep:rustix"]
# **A box's background duty as named jera jobs** (`jobs`, A32-14): a ChainQueue lane per duty,
# a failed look an ALERT line and a FAILED job, stopped at the box's clean stop. gunnar-front
# turns it on; gunnar-server only for its job queue (gc, purge, mirror).
jobs = ["dep:jera", "dep:tokio", "dep:serde_json", "dep:anyhow", "dep:nordisk-pairing"]

[dependencies]
# `env` so `--data-root` can read `GUNNAR_DATA_ROOT`, exactly as before.
clap = { workspace = true, features = ["env"] }
tracing.workspace = true
tracing-subscriber.workspace = true

# Small conversions the CLI enums carry: `WantPolicyArg::to_wire`,
# `LevelArg::to_proto`, the issuer/leaf day defaults, and `DepthArgs`. Each is
# optional and gated by the half that uses it, so a client build links no
# gunnar-wire and a server build links no gunnar-proto.
gunnar-core = { workspace = true, optional = true }
gunnar-wire = { workspace = true, optional = true }
gunnar-client = { workspace = true, optional = true }
gunnar-proto = { workspace = true, optional = true }

# Only `logging::spawn_signal_control` (SIGUSR1/2 log-level control) needs it,
# and only on the server, so it rides the `server` feature.
tokio = { workspace = true, optional = true }
rustix = { workspace = true, optional = true, features = ["pipe", "stdio"] }
# jera from crates.io (0.2.1, the release whose chain worker only looks at the exclusive gate, RA3-8): a lone clone
# builds it as it is; no sibling patch.
jera = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
anyhow = { workspace = true, optional = true }
# A job's `Round` and `Say` are the thread duty's (nordisk-pairing `duty`, 0.5.27 on crates.io):
# ONE contract for both (A32-30: gunnar_common::duty, the copy, is gone).
nordisk-pairing = { version = "0.5.27", default-features = false, optional = true }

[dev-dependencies]
tokio = { workspace = true }