]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #40780 - aidanhs:aphs-cache-git-modules, r=alexcrichton
authorCorey Farwell <coreyf@rwell.org>
Wed, 29 Mar 2017 20:53:29 +0000 (16:53 -0400)
committerGitHub <noreply@github.com>
Wed, 29 Mar 2017 20:53:29 +0000 (16:53 -0400)
commita9dc8ac7ac5dee13675b01ea7db8a93d90d40cf2
treef76cb929c8dd1e4da27b14656a56b4e0a99c330f
parente1cec5d4bf626f151a779323e16d62fe60117086
parent96e174febdd9e0f3624b59e8411332b3e46eb97b
Rollup merge of #40780 - aidanhs:aphs-cache-git-modules, r=alexcrichton

Attempt to cache git modules

Partial resolution of #40772, appveyor remains to be done once travis looks like it's working ok.

The approach in this PR is based on the `--reference` flag to `git-clone`/`git-submodule --update` and is a compromise based on the current limitations of the tools we're using.

The ideal would be:
1. have a cached pristine copy of rust-lang/rust master in `$HOME/rustsrc` with all submodules initialised
2. clone the PR branch with `git clone --recurse-submodules --reference $HOME/rustsrc git@github.com:rust-lang/rust.git`

This would (in the nonexistent ideal world) use the pristine copy as an object cache for the top level repo and all submodules, transferring over the network only the changes on the branch. Unfortunately, a) there is no way to manually control the initial clone with travis and b) even if there was, cloned submodules don't use the submodules of the reference as an object cache. So the steps we end up with are:

1. have a cached pristine copy of rust-lang/rust master in `$HOME/rustsrc` with all submodules initialised
2. have a cloned PR branch
3. extract the path of each submodule, and explicitly `git submodule update --init --reference $HOME/rustsrc/$module $module` (i.e. point directly to the location of the pristine submodule repo) for each one

I've also taken some care to make this forward compatible, both for adding and removing submodules.

r? @alexcrichton
.travis.yml
appveyor.yml