Skip to main content

toolkit_zero/dependency-graph/
mod.rs

1//! Build-time dependency-graph fingerprinting (**IronPrint**).
2//!
3//! Two mutually independent feature gates control the facility:
4//!
5//! | Feature | Provided symbols |
6//! |---|---|
7//! | `dependency-graph-build` | [`build::generate_ironprint`] — writes a compact, normalised `ironprint.json` to `$OUT_DIR`;<br>[`build::export`] — optionally writes a pretty-printed copy alongside `Cargo.toml` |
8//! | `dependency-graph-capture` | [`capture::parse`] — deserialises the embedded snapshot into a typed [`capture::IronprintData`];<br>[`capture::as_bytes`] — returns the raw, deterministic JSON bytes |
9//!
10//! Place `dependency-graph-build` in `[build-dependencies]` and
11//! `dependency-graph-capture` in `[dependencies]`; neither implies the other.
12//!
13//! ## Concerns
14//!
15//! * The fingerprint is stored as **plain text** in the binary's read-only data
16//!   section. It is informational in nature; it does not constitute a security
17//!   boundary and is not tamper-evident.
18//! * Calling `export(true)` writes `ironprint.json` to the crate root. Add this
19//!   file to `.gitignore` to prevent unintentional exposure of build-environment
20//!   details.
21//! * The snapshot is fixed at compile time and does not reflect runtime state.
22
23#[cfg(feature = "dependency-graph-build")]
24pub mod build;
25
26#[cfg(feature = "dependency-graph-capture")]
27pub mod capture;
28
29#[cfg(feature = "backend-deps")]
30pub mod backend_deps;