repo/lockfile-committed/rust
Dependency lockfile is committed
Implements repo/lockfile-committed for rust.
| Severity | error |
| Tiers | 1, 2 |
| Stacks | rust |
| Scope | each |
| Kind | expr |
| Source | library v0.2.0 |
| Selected by | fleetlint-recommended@v0.2.0 |
Requirement
Cargo.lock is tracked when Cargo.toml declares dependencies or a workspace; a workspace member uses the Cargo.lock of the workspace root above it.
Why
Builds are reproducible only when dependency versions are pinned in git.
Check
"Cargo.lock" in tracked() || ["../", "../../", "../../../"].exists(d, file(d + "Cargo.lock") && file(d + "Cargo.toml") && text(d + "Cargo.toml").matches(r'(?m)^\[workspace\]')) || !text("Cargo.toml").matches(r'\[((workspace\.)?(dev-|build-)?dependencies|workspace)\]')Fix
Run cargo generate-lockfile and commit Cargo.lock.
Agent instruction: Run the package manager to produce the lockfile, remove any .gitignore entry for it, and commit it.
See: https://fleetlint.org/baseline/#dependencies, https://fleetlint.org/stacks/#rust
Generated by fleetlint docs from catalog v0.2.0.