Expand description
cargo-build-rx: a compile-time diagnostic and prescription tool for Rust projects.
The tool reads a project’s cargo metadata, its Cargo.toml, its
.cargo/config.toml, and a few environment variables, then runs a set of
pure-function checks over that gathered context::ProjectContext. Each
check returns finding::Findings with a severity, an estimated impact,
and (usually) a concrete fix. No part of the target project is compiled.
The ten checks are:
linker: recommends a fast linker (mold/lld) on Linux, or split debug info on macOS.profile: flagsdebug = 2,opt-level > 0in dev, and a missingbuild-overrideopt-level for proc-macros.duplicates: the same crate compiled in several distinct versions.proc-macros: thesyn1.x/2.x split and a high proc-macro count.build-scripts: an inventory ofbuild.rscrates, flagging nativelinks.features: heavy default feature sets (e.g.tokiofull).dev-deps: heavy dev-dependencies such ascriterionorproptest.toolchain: the installed toolchain versus the project’s MSRV.workspace: large workspaces without aworkspace-hackcrate.incremental:CARGO_INCREMENTAL=0set in a local dev shell.
§Library usage
The check engine is exposed so it can be embedded or tested directly:
use cargo_build_rx::{checks, context::ProjectContext};
let ctx = ProjectContext::gather(None)?;
let findings = checks::run_checks(&ctx, &[], &[]);
println!("{} findings", findings.len());Modules§
- checks
- The check registry and the
Checktrait every diagnostic implements. - cli
- Command-line surface: the
cargo build-rxargument parser. - context
- Gathers everything the checks need, once, up front.
- finding
- The data model every check produces:
Findingand its parts. - output
- Rendering: turn a slice of
Findings into terminal text or JSON.