Build with the lockfile enforced
Refuse dependency resolution changes during CI.
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.
Refuse dependency resolution changes during CI.
cargo build --lockedUseful when CI should use the committed lockfile exactly and fail if it would need updating.
Run tests without silently changing dependencies.
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.
Inspect environment configuration in shells or CI jobs.
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.
Use very verbose mode to surface build-script details.
cargo build -vvBuild scripts communicate with Cargo through printed instructions, so extra verbosity often helps.
Prevent unnecessary build-script reruns.
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.
Compile and install from the current path.
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.
Run Cargo’s publish checks as a dry run.
cargo publish --dry-runA strong preflight check for Rust CLI crates before an actual registry upload.