LinuxCommandLibrary

cargo-verify-project

Verify a Cargo project's integrity

TLDR

Check the correctness of the current project's manifest

$ cargo verify-project
copy

Check the correctness of the specified manifest file
$ cargo verify-project --manifest-path [path/to/Cargo.toml]
copy

SYNOPSIS

cargo verify-project [OPTIONS]

PARAMETERS

--manifest-path
    Path to Cargo.toml

-v, --verbose ...
    Use verbose output (-vv very verbose)

-q, --quiet
    No output printed to stdout

--color
    Control when colored output is used: auto, always, never

--frozen
    Do not update lock file

--locked
    Requires Cargo.lock to be up to date

--offline
    Operate without network access

-Z ...
    Unstable (nightly-only) flags to Cargo

-h, --help
    Print help information

-V, --version
    Print version information

DESCRIPTION

The cargo verify-project command checks the integrity of a Rust package's contents on disk without compiling the code. It validates the package metadata in Cargo.toml, ensures all declared files exist, verifies file checksums against Cargo.lock, and confirms the local .crate file matches the registry version.

This is particularly useful in continuous integration pipelines or after switching Git branches, where you want to confirm the project files are correct before a full build. It detects issues like missing files, corrupted downloads, or metadata inconsistencies quickly, saving time on expensive compilation steps.

Unlike cargo check, which compiles for type-checking, verify-project focuses solely on package structure and checksums, making it lightweight and fast.

CAVEATS

Does not compile or type-check code; only verifies files and metadata. Requires Cargo.lock for checksum validation.

EXAMPLE

cargo verify-project
Verifies the current package.

cargo verify-project --manifest-path ./myproj/Cargo.toml
Verifies a specific workspace member.

HISTORY

Introduced in Cargo 1.29.0 (2018) as a stable command to enable fast package verification, evolving from earlier unstable features for CI efficiency.

SEE ALSO

Copied to clipboard