From d46aec562d1fbe2c5eb4afcbc359e87b924d6b5b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 12 May 2015 21:22:14 -0700 Subject: [PATCH] Update Cargo to rust master There was a lifetime parameter regression in git2-rs which prevented Cargo from building on nightly --- Cargo.lock | 72 ++++++++++++++++++---------------- Cargo.toml | 1 + src/cargo/sources/git/utils.rs | 2 +- src/rustversion.txt | 2 +- tests/support/mod.rs | 13 +++++- tests/test_cargo_build_auth.rs | 3 +- tests/tests.rs | 1 + 7 files changed, 57 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0571e5198..9ca3379ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,16 +3,17 @@ name = "cargo" version = "0.2.0" dependencies = [ "advapi32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bufstream 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "curl 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 0.6.64 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "git2-curl 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git)", "kernel32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", @@ -25,7 +26,7 @@ dependencies = [ "threadpool 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "url 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -42,16 +43,21 @@ name = "bitflags" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "bufstream" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "curl" version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "curl-sys 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "url 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -59,10 +65,10 @@ name = "curl-sys" version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -89,7 +95,7 @@ name = "flate2" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "miniz-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -100,13 +106,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "git2" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libgit2-sys 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "url 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -115,9 +121,9 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "curl 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "url 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -140,19 +146,19 @@ dependencies = [ [[package]] name = "libc" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libgit2-sys" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "libssh2-sys 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -168,10 +174,10 @@ name = "libssh2-sys" version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -179,8 +185,8 @@ name = "libz-sys" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -188,7 +194,7 @@ name = "log" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -202,7 +208,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -211,7 +217,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -220,14 +226,14 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "libressl-pnacl-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pkg-config" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -243,7 +249,7 @@ name = "rand" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -279,7 +285,7 @@ name = "tar" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -310,7 +316,7 @@ version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -323,7 +329,7 @@ dependencies = [ [[package]] name = "url" -version = "0.2.31" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -335,6 +341,6 @@ name = "winapi" version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/Cargo.toml b/Cargo.toml index e7a54b02c..d83728057 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,6 +39,7 @@ dependencies = { winapi = "0.1", advapi32-sys = "0.1", kernel32-sys = "0.1" } [dev-dependencies] tempdir = "0.3" hamcrest = { git = "https://github.com/carllerche/hamcrest-rust.git" } +bufstream = "0.1" [[bin]] name = "cargo" diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs index 2ce6e4224..c1d0b6068 100644 --- a/src/cargo/sources/git/utils.rs +++ b/src/cargo/sources/git/utils.rs @@ -407,7 +407,7 @@ pub fn fetch(repo: &git2::Repository, url: &str, cb.credentials(|a, b, c| f(a, b, c)); let mut remote = try!(repo.remote_anonymous(&url, Some(refspec))); try!(remote.add_fetch("refs/tags/*:refs/tags/*")); - remote.set_callbacks(&mut cb); + remote.set_callbacks(cb); try!(remote.fetch(&["refs/tags/*:refs/tags/*", refspec], None)); Ok(()) }) diff --git a/src/rustversion.txt b/src/rustversion.txt index 29bc1583f..17c78faed 100644 --- a/src/rustversion.txt +++ b/src/rustversion.txt @@ -1 +1 @@ -2015-05-03 +2015-05-11 diff --git a/tests/support/mod.rs b/tests/support/mod.rs index cda18976c..fa004f254 100644 --- a/tests/support/mod.rs +++ b/tests/support/mod.rs @@ -4,6 +4,7 @@ use std::ffi::OsStr; use std::fmt; use std::fs; use std::io::prelude::*; +use std::os; use std::path::{Path, PathBuf}; use std::process::Output; use std::str; @@ -65,10 +66,20 @@ impl SymlinkBuilder { SymlinkBuilder { dst: dst, src: src } } + #[cfg(unix)] fn mk(&self) -> Result<(), String> { try!(mkdir_recursive(&self.dirname())); - fs::soft_link(&self.dst, &self.src) + os::unix::fs::symlink(&self.dst, &self.src) + .with_err_msg(format!("Could not create symlink; dst={} src={}", + self.dst.display(), self.src.display())) + } + + #[cfg(windows)] + fn mk(&self) -> Result<(), String> { + try!(mkdir_recursive(&self.dirname())); + + os::windows::fs::symlink_file(&self.dst, &self.src) .with_err_msg(format!("Could not create symlink; dst={} src={}", self.dst.display(), self.src.display())) } diff --git a/tests/test_cargo_build_auth.rs b/tests/test_cargo_build_auth.rs index 774ad6526..a8e88cbd1 100644 --- a/tests/test_cargo_build_auth.rs +++ b/tests/test_cargo_build_auth.rs @@ -1,8 +1,9 @@ use std::collections::HashSet; -use std::io::BufStream; use std::io::prelude::*; use std::net::TcpListener; use std::thread; + +use bufstream::BufStream; use git2; use support::{project, execs, UPDATING}; diff --git a/tests/tests.rs b/tests/tests.rs index 4d3ff6d77..1b72798f0 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -4,6 +4,7 @@ extern crate rustc_serialize; extern crate cargo; extern crate flate2; extern crate git2; +extern crate bufstream; extern crate hamcrest; extern crate tar; extern crate term;