Skip to content

Documentation for cargo vendor use cases #7520

@Firstyear

Description

@Firstyear

Problem

Cargo vendor has limited docs : https://doc.rust-lang.org/nightly/cargo/commands/cargo-vendor.html . While this describes what cargo vendor does as a tool, it doesn't encompass the larger needs of an opensource project to use vendoring for offline builds in build farms etc.

As a result, while attempting to integrate rust into a project, we have found that certain cases are non-intuitive or may not work.

I would like to ask that cargo vendor be documented with how a project would integrate it into their work flows. Important considerations are:

  • We need to ship and provide .cargo/config in our source tree so that developers have consistent relative paths to vendor, and unpacked tar-balls match git trees. We also can't assume paths in offline build tools for various companies
  • how to use cargo build/rustc with offline builds and vendored dependencies.
  • how to use cargo test with offline builds and vendored dependencies
  • how to correctly use cargo vendor to acquire dependencies
  • how to perform online builds even in the presence of a source tree .cargo/config for developers who are updating dependencies, or rather, to smooth "on boarding" so we don't need to ask developers to vendor/prepare their environments to do builds.

These are all important aspects that today we have struggled with with cargo vendor, so having these generic workflows documented would really help other projects to adopt cargo with vendoring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-documenting-cargo-itselfArea: Cargo's documentationC-bugCategory: bugCommand-vendorE-mediumExperience: MediumS-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions