cargo build --lockedUseful when CI should use the committed lockfile exactly and fail if it would need updating.
Commands for debugging CI failures, environment mismatches, build script output, installation problems, and publish checks in Rust CLI projects.
Compare local and CI behavior with reproducible commands and config checks.
cargo build --lockedUseful when CI should use the committed lockfile exactly and fail if it would need updating.
cargo test --lockedA good CI default for reproducible Rust CLI builds.
cargo build --frozenUseful in stricter CI contexts where both the lockfile and local cache state should already be ready.
cargo config getHelpful when registry, network, target, or build settings differ between local and CI environments.
env | sort | grep -E '^(CARGO|RUST|CC|AR|PKG_CONFIG)'Useful for spotting overrides that affect compilers, targets, registries, or native linking.
Investigate build-script behavior and preflight package publication.
cargo build -vvBuild scripts communicate with Cargo through printed instructions, so extra verbosity often helps.
fn main() {
println!("cargo::rerun-if-changed=src/schema.sql");
}Useful when debugging why `build.rs` seems to rerun too often or not often enough.
cargo install --path .Good for reproducing installation issues that users might hit when installing the CLI.
cargo install --path . --forceUseful when testing changed package metadata or binary names during local iteration.
cargo package --listUseful when publication issues are caused by missing files, ignored files, or unexpected package contents.
cargo publish --dry-runA strong preflight check for Rust CLI crates before an actual registry upload.