Switch the build system from super:: to crate::

This was a left over from when build_system/main.rs was at ./y.rs.
This commit is contained in:
bjorn3 2023-07-24 13:27:17 +00:00
parent 0b1a9d735b
commit e5197cf1de
8 changed files with 38 additions and 37 deletions

View File

@ -1,8 +1,8 @@
use super::build_sysroot; use crate::build_sysroot;
use super::path::Dirs; use crate::path::Dirs;
use super::prepare::GitRepo; use crate::prepare::GitRepo;
use super::utils::{spawn_and_wait, CargoProject, Compiler}; use crate::utils::{spawn_and_wait, CargoProject, Compiler};
use super::{CodegenBackend, SysrootKind}; use crate::{CodegenBackend, SysrootKind};
static ABI_CAFE_REPO: GitRepo = GitRepo::github( static ABI_CAFE_REPO: GitRepo = GitRepo::github(
"Gankra", "Gankra",

View File

@ -2,10 +2,10 @@
use std::io::Write; use std::io::Write;
use std::path::Path; use std::path::Path;
use super::path::{Dirs, RelPath}; use crate::path::{Dirs, RelPath};
use super::prepare::GitRepo; use crate::prepare::GitRepo;
use super::rustc_info::get_file_name; use crate::rustc_info::get_file_name;
use super::utils::{hyperfine_command, spawn_and_wait, Compiler}; use crate::utils::{hyperfine_command, spawn_and_wait, Compiler};
static SIMPLE_RAYTRACER_REPO: GitRepo = GitRepo::github( static SIMPLE_RAYTRACER_REPO: GitRepo = GitRepo::github(
"ebobby", "ebobby",

View File

@ -1,9 +1,9 @@
use std::env; use std::env;
use std::path::PathBuf; use std::path::PathBuf;
use super::path::{Dirs, RelPath}; use crate::path::{Dirs, RelPath};
use super::rustc_info::get_file_name; use crate::rustc_info::get_file_name;
use super::utils::{is_ci, is_ci_opt, maybe_incremental, CargoProject, Compiler, LogGroup}; use crate::utils::{is_ci, is_ci_opt, maybe_incremental, CargoProject, Compiler, LogGroup};
pub(crate) static CG_CLIF: CargoProject = CargoProject::new(&RelPath::SOURCE, "cg_clif"); pub(crate) static CG_CLIF: CargoProject = CargoProject::new(&RelPath::SOURCE, "cg_clif");
@ -45,7 +45,7 @@ pub(crate) fn build_backend(
cmd.env("RUSTFLAGS", rustflags); cmd.env("RUSTFLAGS", rustflags);
eprintln!("[BUILD] rustc_codegen_cranelift"); eprintln!("[BUILD] rustc_codegen_cranelift");
super::utils::spawn_and_wait(cmd); crate::utils::spawn_and_wait(cmd);
CG_CLIF CG_CLIF
.target_dir(dirs) .target_dir(dirs)

View File

@ -2,13 +2,13 @@
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::Command; use std::process::Command;
use super::path::{Dirs, RelPath}; use crate::path::{Dirs, RelPath};
use super::rustc_info::get_file_name; use crate::rustc_info::get_file_name;
use super::utils::{ use crate::utils::{
maybe_incremental, remove_dir_if_exists, spawn_and_wait, try_hard_link, CargoProject, Compiler, maybe_incremental, remove_dir_if_exists, spawn_and_wait, try_hard_link, CargoProject, Compiler,
LogGroup, LogGroup,
}; };
use super::{CodegenBackend, SysrootKind}; use crate::{config, CodegenBackend, SysrootKind};
static DIST_DIR: RelPath = RelPath::DIST; static DIST_DIR: RelPath = RelPath::DIST;
static BIN_DIR: RelPath = RelPath::DIST.join("bin"); static BIN_DIR: RelPath = RelPath::DIST.join("bin");
@ -185,7 +185,7 @@ fn build_sysroot_for_triple(
#[must_use] #[must_use]
fn build_llvm_sysroot_for_triple(compiler: Compiler) -> SysrootTarget { fn build_llvm_sysroot_for_triple(compiler: Compiler) -> SysrootTarget {
let default_sysroot = super::rustc_info::get_default_sysroot(&compiler.rustc); let default_sysroot = crate::rustc_info::get_default_sysroot(&compiler.rustc);
let mut target_libs = SysrootTarget { triple: compiler.triple, libs: vec![] }; let mut target_libs = SysrootTarget { triple: compiler.triple, libs: vec![] };
@ -234,7 +234,7 @@ fn build_clif_sysroot_for_triple(
let build_dir = STANDARD_LIBRARY.target_dir(dirs).join(&compiler.triple).join(channel); let build_dir = STANDARD_LIBRARY.target_dir(dirs).join(&compiler.triple).join(channel);
if !super::config::get_bool("keep_sysroot") { if !config::get_bool("keep_sysroot") {
// Cleanup the deps dir, but keep build scripts and the incremental cache for faster // Cleanup the deps dir, but keep build scripts and the incremental cache for faster
// recompilation as they are not affected by changes in cg_clif. // recompilation as they are not affected by changes in cg_clif.
remove_dir_if_exists(&build_dir.join("deps")); remove_dir_if_exists(&build_dir.join("deps"));
@ -289,8 +289,8 @@ fn build_clif_sysroot_for_triple(
} }
fn build_rtstartup(dirs: &Dirs, compiler: &Compiler) -> Option<SysrootTarget> { fn build_rtstartup(dirs: &Dirs, compiler: &Compiler) -> Option<SysrootTarget> {
if !super::config::get_bool("keep_sysroot") { if !config::get_bool("keep_sysroot") {
super::prepare::prepare_stdlib(dirs, &compiler.rustc); crate::prepare::prepare_stdlib(dirs, &compiler.rustc);
} }
if !compiler.triple.ends_with("windows-gnu") { if !compiler.triple.ends_with("windows-gnu") {

View File

@ -1,7 +1,7 @@
use std::fs; use std::fs;
use std::path::PathBuf; use std::path::PathBuf;
use super::utils::remove_dir_if_exists; use crate::utils::remove_dir_if_exists;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub(crate) struct Dirs { pub(crate) struct Dirs {

View File

@ -3,18 +3,18 @@
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::Command; use std::process::Command;
use super::build_sysroot::STDLIB_SRC; use crate::build_sysroot::STDLIB_SRC;
use super::path::{Dirs, RelPath}; use crate::path::{Dirs, RelPath};
use super::rustc_info::get_default_sysroot; use crate::rustc_info::get_default_sysroot;
use super::utils::{ use crate::utils::{
copy_dir_recursively, git_command, remove_dir_if_exists, retry_spawn_and_wait, spawn_and_wait, copy_dir_recursively, git_command, remove_dir_if_exists, retry_spawn_and_wait, spawn_and_wait,
}; };
pub(crate) fn prepare(dirs: &Dirs) { pub(crate) fn prepare(dirs: &Dirs) {
RelPath::DOWNLOAD.ensure_exists(dirs); RelPath::DOWNLOAD.ensure_exists(dirs);
super::tests::RAND_REPO.fetch(dirs); crate::tests::RAND_REPO.fetch(dirs);
super::tests::REGEX_REPO.fetch(dirs); crate::tests::REGEX_REPO.fetch(dirs);
super::tests::PORTABLE_SIMD_REPO.fetch(dirs); crate::tests::PORTABLE_SIMD_REPO.fetch(dirs);
} }
pub(crate) fn prepare_stdlib(dirs: &Dirs, rustc: &Path) { pub(crate) fn prepare_stdlib(dirs: &Dirs, rustc: &Path) {

View File

@ -1,16 +1,17 @@
use super::build_sysroot;
use super::config;
use super::path::{Dirs, RelPath};
use super::prepare::{apply_patches, GitRepo};
use super::rustc_info::get_default_sysroot;
use super::utils::{spawn_and_wait, spawn_and_wait_with_input, CargoProject, Compiler, LogGroup};
use super::{CodegenBackend, SysrootKind};
use std::env; use std::env;
use std::ffi::OsStr; use std::ffi::OsStr;
use std::fs; use std::fs;
use std::path::PathBuf; use std::path::PathBuf;
use std::process::Command; use std::process::Command;
use crate::build_sysroot;
use crate::config;
use crate::path::{Dirs, RelPath};
use crate::prepare::{apply_patches, GitRepo};
use crate::rustc_info::get_default_sysroot;
use crate::utils::{spawn_and_wait, spawn_and_wait_with_input, CargoProject, Compiler, LogGroup};
use crate::{CodegenBackend, SysrootKind};
static BUILD_EXAMPLE_OUT_DIR: RelPath = RelPath::BUILD.join("example"); static BUILD_EXAMPLE_OUT_DIR: RelPath = RelPath::BUILD.join("example");
struct TestCase { struct TestCase {

View File

@ -5,7 +5,7 @@
use std::process::{self, Command, Stdio}; use std::process::{self, Command, Stdio};
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use super::path::{Dirs, RelPath}; use crate::path::{Dirs, RelPath};
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub(crate) struct Compiler { pub(crate) struct Compiler {