Skip to content

Add --default-target flag to cargo fetch #15444

Open
@zopsicle

Description

@zopsicle

Problem

The documentation for cargo fetch reads:

If --target is not specified, then all target dependencies are fetched.

I only need dependencies for the default target. With “default target” I mean the target that a plain cargo build would assume.

Proposed Solution

Add a --default-target option to cargo fetch that would be equivalent to --target <default target>, e.g. --target x86_64-unknown-linux-gnu if cargo build would assume x86_64-unknown-linux-gnu.

Notes

#9423 seems similar but for cargo metadata.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-fetchS-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