bail!("jobs must be at least 1")
}
- let rustc_info_cache = ws.target_dir().join(".rustc_info.json").into_path_unlocked();
+ let rustc_info_cache = ws.target_dir()
+ .join(".rustc_info.json")
+ .into_path_unlocked();
let mut build_config = BuildConfig::new(config, jobs, &target, Some(rustc_info_cache))?;
build_config.release = release;
build_config.test = mode == CompileMode::Test || mode == CompileMode::Bench;
Rustc::new(
self.get_tool("rustc")?,
self.maybe_get_tool("rustc_wrapper")?,
- &self.home().join("bin").join("rustc").into_path_unlocked(),
+ &self.home()
+ .join("bin")
+ .join("rustc")
+ .into_path_unlocked()
+ .with_extension(env::consts::EXE_EXTENSION),
if self.cache_rustc_info {
cache_location
} else {
}
pub fn mtime(path: &Path) -> CargoResult<FileTime> {
- let meta =
- fs::metadata(path).chain_err(|| format!("failed to stat `{}`", path.display()))?;
+ let meta = fs::metadata(path).chain_err(|| format!("failed to stat `{}`", path.display()))?;
Ok(FileTime::from_last_modification_time(&meta))
}
// If we don't see rustup env vars, but it looks like the compiler
// is managed by rustup, we conservatively bail out.
let maybe_rustup = rustup_rustc == path;
- match (maybe_rustup, env::var("RUSTUP_HOME"), env::var("RUSTUP_TOOLCHAIN")) {
+ match (
+ maybe_rustup,
+ env::var("RUSTUP_HOME"),
+ env::var("RUSTUP_TOOLCHAIN"),
+ ) {
(_, Ok(rustup_home), Ok(rustup_toolchain)) => {
debug!("adding rustup info to rustc fingerprint");
rustup_toolchain.hash(&mut hasher);
rustup_home.hash(&mut hasher);
- let rustup_rustc = Path::new(&rustup_home)
+ let real_rustc = Path::new(&rustup_home)
.join("toolchains")
.join(rustup_toolchain)
.join("bin")
- .join("rustc");
- paths::mtime(&rustup_rustc)?.hash(&mut hasher);
- }
- (true, _, _) => {
- bail!("probably rustup rustc, but without rustup's env vars")
+ .join("rustc")
+ .with_extension(env::consts::EXE_EXTENSION);
+ paths::mtime(&real_rustc)?.hash(&mut hasher);
}
+ (true, _, _) => bail!("probably rustup rustc, but without rustup's env vars"),
_ => (),
}