CARGO-VERIFY-PROJECT(1)

πŸ“¦
version 1.78.0 Β· 4 versions
, in opensuse-leap 16.0, ubuntu jammy, ubuntu noble

πŸ’– CARGO-VERIFY-PROJECT πŸ’–

okay bestie, welcome to cargo-verify-project from the General Commands Manual β€” it's a whole lil vibe and honestly it's giving "glow-up check for your manifest". let's get into it 🫢


✨ NAME ✨

cargo-verify-project β€” check the correctness of a crate manifest πŸŽ€


🌸 SYNOPSIS 🌸

cargo verify-project [options]

πŸ¦‹ DESCRIPTION πŸ¦‹

so the way this works is: this command parses your local manifest and does a validity check on it. and then β€” plot twist β€” it spits out a JSON object with the result. it's not a "yay you did it" text, it's literally JSON. periodt.

if your validation slays, you get:

{"success":"true"}

and if your workspace is invalid, you get:

{"invalid":"human-readable error message"}

like, it'll tell you what's wrong in human-readable form, so you're not just staring at a mystery. πŸ’…


πŸ’œ OPTIONS πŸ’œ

πŸŽ€ Display Options

  • -v, --verbose β€” use verbose output. you can specify it twice for "very verbose" output, which includes extra stuff like dependency warnings and build script output. also settable with the term.verbose config value (https://doc.rust-lang.org/cargo/reference/config.html). it's giving "tell me everything" energy πŸ”₯
  • -q, --quiet β€” do not print cargo log messages. also settable with the term.quiet config value (https://doc.rust-lang.org/cargo/reference/config.html). this is the "shhh, main character moment" flag 🀫
  • --color when β€” controls when colored output gets used. valid values:
    • auto (default): automatically detect if color support is available on the terminal. iykyk 🌈
    • always: always display colors. no thoughts, just vibes πŸ’…
    • never: never display colors. monochrome era πŸ–€
    • also settable with the term.color config value (https://doc.rust-lang.org/cargo/reference/config.html)

🌸 Manifest Options

  • --manifest-path path β€” path to the Cargo.toml file. by default, Cargo searches for the Cargo.toml file in the current directory or any parent directory. it will literally go looking for it like a bestie hunting you down in a crowd 🫢
  • --frozen, --locked β€” either of these flags requires that the Cargo.lock file is up-to-date. if the lock file is missing, or it needs to be updated, Cargo will exit with an error. the --frozen flag also prevents Cargo from attempting to access the network to determine if it's out-of-date.

these may be used in environments where you want to assert that the Cargo.lock file is up-to-date (such as a CI build) or want to avoid network access. so like, "no cap, my lockfile is correct" energy ✨

  • --offline β€” prevents Cargo from accessing the network for any reason. without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. with this flag, Cargo will attempt to proceed without the network if possible.
beware bestie 😭 this may result in different dependency resolution than online mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. see the cargo-fetch(1) command to download dependencies before going offline.

also settable with the net.offline config value (https://doc.rust-lang.org/cargo/reference/config.html)

πŸ’… Common Options

  • +toolchain β€” if Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). see the rustup documentation (https://rust-lang.github.io/rustup/overrides.html) for more info about how toolchain overrides work. choosing your toolchain is so main character energy πŸ‘‘
  • --config KEY=VALUE or PATH β€” overrides a Cargo configuration value. the argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. this flag may be specified multiple times. see the command-line overrides section (https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides) for more information.
  • -C PATH β€” changes the current working directory before executing any specified operations. this affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. this option must appear before the command name, for example cargo -C path/to/my-project build.
this option is only available on the nightly channel (https://doc.rust-lang.org/book/appendix-07-nightly-rust.html) and requires the -Z unstable-options flag to enable (see #10098 https://github.com/rust-lang/cargo/issues/10098). nightly-only, bestie, don't try this on stable 😭
  • -h, --help β€” prints help information. the classic πŸŽ€
  • -Z flag β€” unstable (nightly-only) flags to Cargo. run cargo -Z help for details. unstable = experimental vibes, handle with care πŸ’€

🌈 ENVIRONMENT 🌈

see the reference (https://doc.rust-lang.org/cargo/reference/environment-variables.html) for details on environment variables that Cargo reads. it's all in there, fr fr πŸ“–


⭐ EXIT STATUS ⭐

  • 0: the workspace is OK. we love a healthy workspace ✨
  • 1: the workspace is invalid. not the vibe, but at least you know πŸ’€

πŸ“ EXAMPLES πŸ“

  1. check the current workspace for errors:
cargo verify-project

πŸ‘‘ SEE ALSO πŸ‘‘

cargo(1), cargo-package(1)


and that's the whole thing, bestie 🧚 this was cargo-verify-project(1) β€” the footer just says CARGO-VERIFY-PROJECT(1) right back at you, from the General Commands Manual. go verify that manifest, you got this πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from