]> git.proxmox.com Git - cargo.git/commit - src/doc/src/commands/cargo-vendor.md
Import the cargo-vendor subcommand into Cargo
authorAlex Crichton <alex@alexcrichton.com>
Tue, 23 Apr 2019 00:54:27 +0000 (17:54 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 21 May 2019 14:02:17 +0000 (07:02 -0700)
commit3842d8e6f20067f716c99ba39f4d9f2c8abe84f2
treefffd0b85e8224f55f16f2a2e66e7eb9466548a08
parent0ef35b947031dc84fbf50e5d6e79dbd44b5cbbb2
Import the cargo-vendor subcommand into Cargo

This commit imports the external [alexcrichton/cargo-vendor
repository][repo] into Cargo itself. This means it will no longer be
necessary to install the `cargo-vendor` subcommand in order to vendor
dependencies. Additionally it'll always support the latest feature set
of Cargo as it'll be built into Cargo!

All tests were imported as part of this commit, but not all features
were imported. Some flags have been left out that were added later in
the lifetime of `cargo vendor` which seem like they're more questionable
to stabilize. I'm hoping that they can have separate PRs adding their
implementation here, and we can make a decision of their stabilization
at a later date.

The current man page for `cargo vendor -h` will look like:

    cargo-vendor
    Vendor all dependencies for a project locally

    USAGE:
cargo vendor [OPTIONS] [--] [path]

    OPTIONS:
-q, --quiet                    No output printed to stdout
    --manifest-path <PATH>     Path to Cargo.toml
    --no-delete                Don't delete older crates in the vendor directory
-s, --sync <TOML>...           Additional `Cargo.toml` to sync and vendor
    --respect-source-config    Respect `[source]` config in `.cargo/config`
-v, --verbose                  Use verbose output (-vv very verbose/build.rs output)
    --color <WHEN>             Coloring: auto, always, never
    --frozen                   Require Cargo.lock and cache are up to date
    --locked                   Require Cargo.lock is up to date
-Z <FLAG>...                   Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help                     Prints help information

    ARGS:
<path>    Where to vendor crates (`vendor` by default)

    This cargo subcommand will vendor all crates.io and git dependencies for a
    project into the specified directory at `<path>`. After this command completes
    the vendor directory specified by `<path>` will contain all remote sources from
    dependencies specified. Additionally manifest beyond the default one can be
    specified with the `-s` option.

    The `cargo vendor` command will also print out the configuration necessary
    to use the vendored sources, which when needed is then encoded into
    `.cargo/config`.

Since this change is not importing 100% of the functionality of the
existing `cargo vendor` this change does run a risk of being a breaking
change for any folks using such functionality. Executing `cargo vendor`
will favor the built-in command rather than an external subcommand,
causing unimplemented features to become errors about flag usage.

[repo]: https://github.com/alexcrichton/cargo-vendor
21 files changed:
src/bin/cargo/commands/mod.rs
src/bin/cargo/commands/vendor.rs [new file with mode: 0644]
src/cargo/lib.rs
src/cargo/ops/mod.rs
src/cargo/ops/vendor.rs [new file with mode: 0644]
src/cargo/sources/directory.rs
src/cargo/sources/registry/local.rs
src/cargo/sources/registry/remote.rs
src/cargo/util/config.rs
src/cargo/util/sha256.rs
src/doc/man/cargo-vendor.adoc [new file with mode: 0644]
src/doc/man/generated/cargo-metadata.html
src/doc/man/generated/cargo-vendor.html [new file with mode: 0644]
src/doc/src/SUMMARY.md
src/doc/src/commands/cargo-vendor.md [new file with mode: 0644]
src/doc/src/reference/source-replacement.md
src/etc/man/cargo-vendor.1 [new file with mode: 0644]
src/etc/man/cargo.1
tests/testsuite/main.rs
tests/testsuite/support/registry.rs
tests/testsuite/vendor.rs [new file with mode: 0644]