]> git.proxmox.com Git - cargo.git/commit
Support vendoring git repositories
authorAlex Crichton <alex@alexcrichton.com>
Thu, 4 May 2017 03:33:28 +0000 (20:33 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 5 Sep 2017 22:18:07 +0000 (15:18 -0700)
commit5b08b8fe1019147fe489db17a9a8ae7ebe97f9e9
tree90d4e6c6d51cb04eaeab38b3b66e96d812fb78fb
parent4a7cae5cb93eb9388f53e2dc37bf66935c61987f
Support vendoring git repositories

Currently the vendoring support in Cargo primarily only allows replacing
registry sources, e.g. crates.io. Other networked sources of code, such as git
repositories, cannot currently be replaced. The purpose of this commit is to
support vendoring of git dependencies to eventually have support implemented in
the `cargo-vendor` subcommand.

Support for vendoring git repositories required a few subtle changes:

* First and foremost, configuration for source replacement of a git repository
  was added. This looks similar to the `Cargo.toml` configuration of a git
  source.

* The restriction around checksum providing sources was relaxed. If a
  replacement source provides checksums but the replaced source doesn't then
  that's now considered ok unlike it being an error before.

* Lock files can be generated for crates.io crates against vendored sources, but
  lock files cannot be generated against git sources. A lock file must
  previously exist to make use of a vendored git source.

* The `package` field of `.cargo-checksum.json` is now optional, and it is
  intended to be omitted for git sources that are vendored.
src/cargo/core/registry.rs
src/cargo/sources/config.rs
src/cargo/sources/directory.rs
src/cargo/sources/git/source.rs
src/cargo/sources/path.rs
src/cargo/sources/registry/mod.rs
src/cargo/sources/replaced.rs
src/doc/source-replacement.md
tests/directory.rs
tests/resolve.rs