about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-02-14 07:06:25 +0000
committerbors <bors@rust-lang.org>2017-02-14 07:06:25 +0000
commit48bc08247a7b4a5579437df54ca3f4a3fb25ce8d (patch)
tree8fbb2097c8787f3ad9d9ae638bab427143e01c8f /src/tools
parent55013cddefbd8e2616370a72df785c20880189ce (diff)
parentd29f0bc8fa166117e62b1fa2969dd31f415fd887 (diff)
downloadrust-48bc08247a7b4a5579437df54ca3f4a3fb25ce8d.tar.gz
rust-48bc08247a7b4a5579437df54ca3f4a3fb25ce8d.zip
Auto merge of #39728 - eddyb:vendeur-tres-bien, r=alexcrichton
Automate vendoring by invoking cargo-vendor when building src dist tarballs.

This avoids #39633 bringing the `src/vendor` checked into git by #37524, past 200,000 lines of code.

I believe the strategy of having rustbuild run `cargo vendor` during the `dist src` step is sound.

However, the only way to be sure `cargo-vendor` exists is to run `cargo install --force cargo-vendor`, which will recompile it every time (not passing `--force` means you can't tell between "already exists" and "build error"). ~~This is quite suboptimal and I'd like to somehow do it in each `Dockerfile` that would need it.~~

* [ ] Cache `CARGO_HOME` (i.e. `~/.cargo`) between CI runs
  * `bin/cargo-vendor` and the actual caches are the relevant bits
* [x] Do not build `cargo-vendor` all the time
  * ~~Maybe detect `~/.cargo/bin/cargo-vendor` already exists?~~
  * ~~Could also try to build it in a `Dockerfile` but do we have `cargo`/`rustc` there?~~
  * Final solution: check `cargo install --list` for a line starting with `cargo-vendor `

cc @rust-lang/tools
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/tidy/src/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs
index 9962c6ec9af..1bb7919c1d3 100644
--- a/src/tools/tidy/src/main.rs
+++ b/src/tools/tidy/src/main.rs
@@ -42,6 +42,8 @@ fn main() {
     let path = env::args_os().skip(1).next().expect("need an argument");
     let path = PathBuf::from(path);
 
+    let args: Vec<String> = env::args().skip(1).collect();
+
     let mut bad = false;
     bins::check(&path, &mut bad);
     style::check(&path, &mut bad);
@@ -49,7 +51,9 @@ fn main() {
     cargo::check(&path, &mut bad);
     features::check(&path, &mut bad);
     pal::check(&path, &mut bad);
-    deps::check(&path, &mut bad);
+    if !args.iter().any(|s| *s == "--no-vendor") {
+        deps::check(&path, &mut bad);
+    }
 
     if bad {
         panic!("some tidy checks failed");