Skip to content

Commit f636e7c

Browse files
nnethercoteMark-Simulacrum
authored andcommitted
Eliminate the download_cargo check in Sysroot.
It doesn't seem useful any more.
1 parent 5decd95 commit f636e7c

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

collector/src/bin/rustc-perf-collector/sysroot.rs

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use anyhow::{anyhow, Context};
2-
use chrono::{DateTime, TimeZone, Utc};
2+
use chrono::{DateTime, Utc};
33
use collector::Sha;
44
use std::ffi::OsStr;
55
use std::fmt;
@@ -30,8 +30,6 @@ impl Sysroot {
3030
date,
3131
};
3232
let unpack_into = "cache";
33-
// Versions of rustc older than Mar 20 have bugs in their cargo.
34-
let download_cargo = commit.date >= Utc.ymd(2017, 3, 20).and_hms(0, 0, 0);
3533

3634
fs::create_dir_all(&unpack_into)?;
3735

@@ -43,11 +41,9 @@ impl Sysroot {
4341

4442
download.get_and_extract(ModuleVariant::Rustc)?;
4543
download.get_and_extract(ModuleVariant::Std)?;
46-
if download_cargo {
47-
download.get_and_extract(ModuleVariant::Cargo)?;
48-
}
44+
download.get_and_extract(ModuleVariant::Cargo)?;
4945

50-
download.into_sysroot(download_cargo)
46+
download.into_sysroot()
5147
}
5248
}
5349

@@ -100,7 +96,7 @@ impl ModuleVariant {
10096
}
10197

10298
impl SysrootDownload {
103-
fn into_sysroot(self, download_cargo: bool) -> anyhow::Result<Sysroot> {
99+
fn into_sysroot(self) -> anyhow::Result<Sysroot> {
104100
Ok(Sysroot {
105101
rustc: self
106102
.directory
@@ -118,10 +114,7 @@ impl SysrootDownload {
118114
.with_context(|| {
119115
format!("failed to canonicalize rustdoc path for {}", self.rust_sha)
120116
})?,
121-
cargo: if !download_cargo {
122-
// go with cargo present in environment if we need to fallback
123-
PathBuf::from("cargo")
124-
} else {
117+
cargo: {
125118
let path = self.directory.join(&self.rust_sha).join("cargo/bin/cargo");
126119
path.canonicalize().with_context(|| {
127120
format!(

0 commit comments

Comments
 (0)