Skip to content

Use cargo as a library to download the latest version of the crate, even if it's yanked #11693

Open
@marcoieni

Description

@marcoieni

Problem

In release-plz, I download the latest version of a crate published to the cargo registry. This works fine if the latest version isn't yanked.
If the latest version of the crate was yanked, cargo skips it and downloads the previous non-yanked one. Instead, I want to download the latest version of the crate (no matter if it's yanked or not).
I use this code to download crates, which is heavily inspired by cargo-clone.

I saw that here you can pass a yanked_whitelist, however you need to know the yanked version before-hand (not my use case).

Proposed Solution

Can we expose a flag where you can customize if you want to filter yanked crates or not?

Notes

For testing, I found easy to use cargo-clone.
For example, cargo clone htsget-config downloads version 0.1.0. instead of version 0.1.1 (which is yanked).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargo-apiArea: cargo-the-library API and internal code issuesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions