Skip to content

Support cargo vendor for a specific workspace package #12307

Open
@chbaker0

Description

Problem

When run in a workspace, cargo vendor will always vendor all packages for that workspace. This is true even when run from a package subdir (even though the vendor dir will be put in that subdir, confusingly).

It can be useful to vendor the dependencies needed to build some subset of workspace packages.

Example: for projects with their own toolchain build, vendoring the dependencies needed to build the standard library is often desirable. Especially when the standard library is built with an alternative build system. Chromium does this, building the standard library sysroot using its GN build system. cargo vendor will include many unnecessary dependencies right now.

Proposed Solution

Either:

  • cargo vendor in a workspace package will vendor only that packages' dependencies.
  • cargo vendor -p foo will vendor only foo's dependencies. This would match other subcommands' behavior.

Notes

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-workspacesArea: workspacesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-vendorS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions