Skip to content

Rust/Cargo 1.85: cargo audit --no-fetch errors when checking for yanked crates #1333

@laniakea64

Description

@laniakea64

Environment:

$ rustc --version
rustc 1.85.0 (4d91de4e4 2025-02-17)
$ cargo --version
cargo 1.85.0 (d73d2caf9 2024-12-31)
$ cargo-audit --version
cargo-audit 0.21.1

Steps to reproduce:

  1. create a project with some dependencies (the project's Rust edition can be either 2021 or 2024)
cargo new --vcs none foo
cd foo
cargo add clap
  1. audit this project
cargo fetch
cargo audit
  1. delete ~/.cargo/registry and ~/.cargo/.global-cache

  2. audit this project offline

cargo fetch
cargo audit --no-fetch

Expected results: (2) and (4) should produce identical results

Actual results:

(2) works, but (4) produces lots of error: couldn't check if the package is yanked: not found: No such crate in crates.io index: messages.

Neither reinstalling cargo-audit to get latest crates.io dependencies, nor installing with cargo install --git 'https://github.com/rustsec/rustsec.git' cargo-audit, had any effect on this issue.

With downgrading to Rust/Cargo 1.84.1 and repeating the steps, the errors do not occur.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions