use std::fmt;
use std::fs;
use std::path::{Path, PathBuf};
-use std::process::{exit, Command};
+use std::process::Command;
use std::str::FromStr;
use crate::builder::{Builder, TaskPath};
let get_toml = |_| TomlConfig::default();
#[cfg(not(test))]
let get_toml = |file: &Path| {
- use std::process;
-
let contents =
t!(fs::read_to_string(file), format!("config file {} not found", file.display()));
// Deserialize to Value and then TomlConfig to prevent the Deserialize impl of
Ok(table) => table,
Err(err) => {
eprintln!("failed to parse TOML configuration '{}': {}", file.display(), err);
- process::exit(2);
+ crate::detail_exit(2);
}
}
};
println!("help: maybe your repository history is too shallow?");
println!("help: consider disabling `download-rustc`");
println!("help: or fetch enough history to include one upstream commit");
- exit(1);
+ crate::detail_exit(1);
}
// Warn if there were changes to the compiler or standard library since the ancestor commit.
builder.fix_bin_or_dylib(&bin_root.join("bin").join("rustc"));
builder.fix_bin_or_dylib(&bin_root.join("bin").join("rustdoc"));
let lib_dir = bin_root.join("lib");
- for lib in t!(fs::read_dir(lib_dir)) {
+ for lib in t!(fs::read_dir(&lib_dir), lib_dir.display().to_string()) {
let lib = t!(lib);
if lib.path().extension() == Some(OsStr::new("so")) {
builder.fix_bin_or_dylib(&lib.path());
}
Some(sha256)
} else if tarball.exists() {
+ builder.unpack(&tarball, &bin_root, prefix);
return;
} else {
None