Skip to content

Commit 824c9eb

Browse files
committed
Auto merge of #40450 - alexcrichton:fix-cargo, r=alexcrichton
Update Cargo to fix nightly channel This commit updates Cargo with rust-lang/cargo#3820 which includes a fix for rust-lang/cargo#3819. At the same time this also slightly tweaks how rustbuild builds cargo to ensure that all the build information (including git info and such) makes its way into the binary. Closes rust-lang/cargo#3819
2 parents 0066869 + b5798a9 commit 824c9eb

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

.travis.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ matrix:
4747
SRC=.
4848
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
4949
SCCACHE_ERROR_LOG=/tmp/sccache.log
50-
RUST_LOG=sccache
50+
RUST_LOG=sccache=debug
5151
os: osx
5252
osx_image: xcode8.2
5353
install: &osx_install_sccache >
@@ -59,7 +59,7 @@ matrix:
5959
SRC=.
6060
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
6161
SCCACHE_ERROR_LOG=/tmp/sccache.log
62-
RUST_LOG=sccache
62+
RUST_LOG=sccache=debug
6363
os: osx
6464
osx_image: xcode8.2
6565
install: *osx_install_sccache
@@ -71,7 +71,7 @@ matrix:
7171
DEPLOY=1
7272
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
7373
SCCACHE_ERROR_LOG=/tmp/sccache.log
74-
RUST_LOG=sccache
74+
RUST_LOG=sccache=debug
7575
os: osx
7676
osx_image: xcode8.2
7777
install: >
@@ -84,7 +84,7 @@ matrix:
8484
DEPLOY=1
8585
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
8686
SCCACHE_ERROR_LOG=/tmp/sccache.log
87-
RUST_LOG=sccache
87+
RUST_LOG=sccache=debug
8888
os: osx
8989
osx_image: xcode8.2
9090
install: *osx_install_sccache
@@ -101,7 +101,7 @@ matrix:
101101
DEPLOY_ALT=1
102102
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
103103
SCCACHE_ERROR_LOG=/tmp/sccache.log
104-
RUST_LOG=sccache
104+
RUST_LOG=sccache=debug
105105
os: osx
106106
osx_image: xcode8.2
107107
install: *osx_install_sccache

src/bootstrap/channel.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,22 @@ struct Info {
4242

4343
impl GitInfo {
4444
pub fn new(dir: &Path) -> GitInfo {
45-
if !dir.join(".git").is_dir() {
45+
// See if this even begins to look like a git dir
46+
if !dir.join(".git").exists() {
4647
return GitInfo { inner: None }
4748
}
49+
50+
// Make sure git commands work
51+
let out = Command::new("git")
52+
.arg("rev-parse")
53+
.current_dir(dir)
54+
.output()
55+
.expect("failed to spawn git");
56+
if !out.status.success() {
57+
return GitInfo { inner: None }
58+
}
59+
60+
// Ok, let's scrape some info
4861
let ver_date = output(Command::new("git").current_dir(dir)
4962
.arg("log").arg("-1")
5063
.arg("--date=short")

src/bootstrap/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl Build {
232232
None => false,
233233
};
234234
let rust_info = channel::GitInfo::new(&src);
235-
let cargo_info = channel::GitInfo::new(&src.join("src/tools/cargo"));
235+
let cargo_info = channel::GitInfo::new(&src.join("cargo"));
236236

237237
Build {
238238
flags: flags,

0 commit comments

Comments
 (0)