[package]
name = "forkd-controller"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[[bin]]
name = "forkd-controller"
path = "src/main.rs"

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

[dependencies]
forkd-vmm = { path = "../forkd-vmm" }
anyhow.workspace = true
thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
serde.workspace = true
serde_json.workspace = true
clap.workspace = true
axum.workspace = true
axum-server.workspace = true
rustls.workspace = true
parking_lot.workspace = true
# Audit log RFC3339 timestamps. Was hand-rolled (Howard Hinnant's algorithm)
# but had two latent bugs (issue #158): pre-epoch clocks collapsed to
# 1970-01-01 via unwrap_or(0), and the i64→i32 year cast overflowed for
# corrupted state files. `time` is ~30 KiB, already in axum's tree.
time = { version = "0.3", default-features = false, features = ["formatting", "macros"] }
# Constant-time bearer-token comparison (issue #162). The previous
# hand-rolled `constant_time_eq` had two flaws: the "fake work" loop
# on length-mismatch was dead code LLVM would optimize away, and the
# length-difference path was distinguishable from the length-equal
# path by timing. `subtle` is the standard crate, no_std, no deps.
subtle = { version = "2", default-features = false }

# posix_fallocate for the memory.bin pre-allocation in BRANCH path
# (issue #146). Avoids ext4 mballoc cost on writeback.
[target.'cfg(unix)'.dependencies]
libc = "0.2"

# WpBranch::begin_with_external_uffd for the Phase 6.3 mode="live"
# BRANCH path. Linux-only because userfaultfd doesn't exist elsewhere.
[target.'cfg(target_os = "linux")'.dependencies]
forkd-uffd = { path = "../forkd-uffd" }

[dev-dependencies]
tempfile = "3"
tower = "0.5"
reqwest.workspace = true
rcgen.workspace = true
