Expand description
Build info: facts fixed when the application was compiled, answering “exactly which build is running?” in logs, crash reports, and health checks.
The application calls emit from its own build.rs (with sys-lib also in
[build-dependencies]), and build_info! anywhere at
run time:
// build.rs
fn main() {
sys_lib::build::emit();
}let build = sys_lib::build_info!();
println!("{build}"); // site 0.3.0 (9db9e36, release, built 2026-10-21T18:02:11Z)
println!("{}", build.public()); // site 0.3.0: safe for a public health endpointThis module is the only code in sys-lib that runs another program, and it
does so in the application’s build script, never at run time (D-004). It
never fails the build: anything it cannot learn becomes unknown.
Structs§
- Build
Info - Facts fixed when the application was compiled. Get it with
build_info!; every field is a&'static strin the binary, so it costs nothing at run time. - Emitter
- What
emitcaptures. Seeemitter. - Public
Build - The name and version only:
site 0.3.0. SeeBuildInfo::public.
Functions§
- emit
- Emits the build facts for
build_info!. Call it from the application’sbuild.rs. Never fails and never panics. - emitter
- A configurable
emit.