Inline all RelPath::ensure_fresh
This commit is contained in:
parent
1c372caa33
commit
4f213adf09
3 changed files with 7 additions and 11 deletions
|
|
@ -281,13 +281,14 @@ fn build_rtstartup(dirs: &Dirs, compiler: &Compiler) -> Option<SysrootTarget> {
|
|||
return None;
|
||||
}
|
||||
|
||||
RTSTARTUP_SYSROOT.ensure_fresh(dirs);
|
||||
let rtstartup_sysroot = RTSTARTUP_SYSROOT.to_path(dirs);
|
||||
ensure_empty_dir(&rtstartup_sysroot);
|
||||
|
||||
let rtstartup_src = STDLIB_SRC.to_path(dirs).join("library").join("rtstartup");
|
||||
let mut target_libs = SysrootTarget { triple: compiler.triple.clone(), libs: vec![] };
|
||||
|
||||
for file in ["rsbegin", "rsend"] {
|
||||
let obj = RTSTARTUP_SYSROOT.to_path(dirs).join(format!("{file}.o"));
|
||||
let obj = rtstartup_sysroot.join(format!("{file}.o"));
|
||||
let mut build_rtstartup_cmd = Command::new(&compiler.rustc);
|
||||
build_rtstartup_cmd
|
||||
.arg("--target")
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::utils::ensure_empty_dir;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) struct Dirs {
|
||||
pub(crate) source_dir: PathBuf,
|
||||
|
|
@ -61,9 +59,4 @@ impl RelPath {
|
|||
pub(crate) fn ensure_exists(&self, dirs: &Dirs) {
|
||||
fs::create_dir_all(self.to_path(dirs)).unwrap();
|
||||
}
|
||||
|
||||
pub(crate) fn ensure_fresh(&self, dirs: &Dirs) {
|
||||
let path = self.to_path(dirs);
|
||||
ensure_empty_dir(&path);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use crate::path::{Dirs, RelPath};
|
|||
use crate::prepare::{GitRepo, apply_patches};
|
||||
use crate::rustc_info::get_default_sysroot;
|
||||
use crate::shared_utils::rustflags_from_env;
|
||||
use crate::utils::{CargoProject, Compiler, LogGroup, spawn_and_wait};
|
||||
use crate::utils::{CargoProject, Compiler, LogGroup, ensure_empty_dir, spawn_and_wait};
|
||||
use crate::{CodegenBackend, SysrootKind, build_sysroot, config};
|
||||
|
||||
static BUILD_EXAMPLE_OUT_DIR: RelPath = RelPath::BUILD.join("example");
|
||||
|
|
@ -267,7 +267,9 @@ pub(crate) fn run_tests(
|
|||
stdlib_source.clone(),
|
||||
);
|
||||
|
||||
BUILD_EXAMPLE_OUT_DIR.ensure_fresh(dirs);
|
||||
let path = BUILD_EXAMPLE_OUT_DIR.to_path(dirs);
|
||||
ensure_empty_dir(&path);
|
||||
|
||||
runner.run_testsuite(NO_SYSROOT_SUITE);
|
||||
} else {
|
||||
eprintln!("[SKIP] no_sysroot tests");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue