Skip to content

Commit e5197cf

Browse files
committed
Switch the build system from super:: to crate::
This was a left over from when build_system/main.rs was at ./y.rs.
1 parent 0b1a9d7 commit e5197cf

File tree

8 files changed

+38
-37
lines changed

8 files changed

+38
-37
lines changed

build_system/abi_cafe.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use super::build_sysroot;
2-
use super::path::Dirs;
3-
use super::prepare::GitRepo;
4-
use super::utils::{spawn_and_wait, CargoProject, Compiler};
5-
use super::{CodegenBackend, SysrootKind};
1+
use crate::build_sysroot;
2+
use crate::path::Dirs;
3+
use crate::prepare::GitRepo;
4+
use crate::utils::{spawn_and_wait, CargoProject, Compiler};
5+
use crate::{CodegenBackend, SysrootKind};
66

77
static ABI_CAFE_REPO: GitRepo = GitRepo::github(
88
"Gankra",

build_system/bench.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use std::env;
22
use std::io::Write;
33
use std::path::Path;
44

5-
use super::path::{Dirs, RelPath};
6-
use super::prepare::GitRepo;
7-
use super::rustc_info::get_file_name;
8-
use super::utils::{hyperfine_command, spawn_and_wait, Compiler};
5+
use crate::path::{Dirs, RelPath};
6+
use crate::prepare::GitRepo;
7+
use crate::rustc_info::get_file_name;
8+
use crate::utils::{hyperfine_command, spawn_and_wait, Compiler};
99

1010
static SIMPLE_RAYTRACER_REPO: GitRepo = GitRepo::github(
1111
"ebobby",

build_system/build_backend.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std::env;
22
use std::path::PathBuf;
33

4-
use super::path::{Dirs, RelPath};
5-
use super::rustc_info::get_file_name;
6-
use super::utils::{is_ci, is_ci_opt, maybe_incremental, CargoProject, Compiler, LogGroup};
4+
use crate::path::{Dirs, RelPath};
5+
use crate::rustc_info::get_file_name;
6+
use crate::utils::{is_ci, is_ci_opt, maybe_incremental, CargoProject, Compiler, LogGroup};
77

88
pub(crate) static CG_CLIF: CargoProject = CargoProject::new(&RelPath::SOURCE, "cg_clif");
99

@@ -45,7 +45,7 @@ pub(crate) fn build_backend(
4545
cmd.env("RUSTFLAGS", rustflags);
4646

4747
eprintln!("[BUILD] rustc_codegen_cranelift");
48-
super::utils::spawn_and_wait(cmd);
48+
crate::utils::spawn_and_wait(cmd);
4949

5050
CG_CLIF
5151
.target_dir(dirs)

build_system/build_sysroot.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ use std::fs;
22
use std::path::{Path, PathBuf};
33
use std::process::Command;
44

5-
use super::path::{Dirs, RelPath};
6-
use super::rustc_info::get_file_name;
7-
use super::utils::{
5+
use crate::path::{Dirs, RelPath};
6+
use crate::rustc_info::get_file_name;
7+
use crate::utils::{
88
maybe_incremental, remove_dir_if_exists, spawn_and_wait, try_hard_link, CargoProject, Compiler,
99
LogGroup,
1010
};
11-
use super::{CodegenBackend, SysrootKind};
11+
use crate::{config, CodegenBackend, SysrootKind};
1212

1313
static DIST_DIR: RelPath = RelPath::DIST;
1414
static BIN_DIR: RelPath = RelPath::DIST.join("bin");
@@ -185,7 +185,7 @@ fn build_sysroot_for_triple(
185185

186186
#[must_use]
187187
fn build_llvm_sysroot_for_triple(compiler: Compiler) -> SysrootTarget {
188-
let default_sysroot = super::rustc_info::get_default_sysroot(&compiler.rustc);
188+
let default_sysroot = crate::rustc_info::get_default_sysroot(&compiler.rustc);
189189

190190
let mut target_libs = SysrootTarget { triple: compiler.triple, libs: vec![] };
191191

@@ -234,7 +234,7 @@ fn build_clif_sysroot_for_triple(
234234

235235
let build_dir = STANDARD_LIBRARY.target_dir(dirs).join(&compiler.triple).join(channel);
236236

237-
if !super::config::get_bool("keep_sysroot") {
237+
if !config::get_bool("keep_sysroot") {
238238
// Cleanup the deps dir, but keep build scripts and the incremental cache for faster
239239
// recompilation as they are not affected by changes in cg_clif.
240240
remove_dir_if_exists(&build_dir.join("deps"));
@@ -289,8 +289,8 @@ fn build_clif_sysroot_for_triple(
289289
}
290290

291291
fn build_rtstartup(dirs: &Dirs, compiler: &Compiler) -> Option<SysrootTarget> {
292-
if !super::config::get_bool("keep_sysroot") {
293-
super::prepare::prepare_stdlib(dirs, &compiler.rustc);
292+
if !config::get_bool("keep_sysroot") {
293+
crate::prepare::prepare_stdlib(dirs, &compiler.rustc);
294294
}
295295

296296
if !compiler.triple.ends_with("windows-gnu") {

build_system/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::fs;
22
use std::path::PathBuf;
33

4-
use super::utils::remove_dir_if_exists;
4+
use crate::utils::remove_dir_if_exists;
55

66
#[derive(Debug, Clone)]
77
pub(crate) struct Dirs {

build_system/prepare.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ use std::fs;
33
use std::path::{Path, PathBuf};
44
use std::process::Command;
55

6-
use super::build_sysroot::STDLIB_SRC;
7-
use super::path::{Dirs, RelPath};
8-
use super::rustc_info::get_default_sysroot;
9-
use super::utils::{
6+
use crate::build_sysroot::STDLIB_SRC;
7+
use crate::path::{Dirs, RelPath};
8+
use crate::rustc_info::get_default_sysroot;
9+
use crate::utils::{
1010
copy_dir_recursively, git_command, remove_dir_if_exists, retry_spawn_and_wait, spawn_and_wait,
1111
};
1212

1313
pub(crate) fn prepare(dirs: &Dirs) {
1414
RelPath::DOWNLOAD.ensure_exists(dirs);
15-
super::tests::RAND_REPO.fetch(dirs);
16-
super::tests::REGEX_REPO.fetch(dirs);
17-
super::tests::PORTABLE_SIMD_REPO.fetch(dirs);
15+
crate::tests::RAND_REPO.fetch(dirs);
16+
crate::tests::REGEX_REPO.fetch(dirs);
17+
crate::tests::PORTABLE_SIMD_REPO.fetch(dirs);
1818
}
1919

2020
pub(crate) fn prepare_stdlib(dirs: &Dirs, rustc: &Path) {

build_system/tests.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
use super::build_sysroot;
2-
use super::config;
3-
use super::path::{Dirs, RelPath};
4-
use super::prepare::{apply_patches, GitRepo};
5-
use super::rustc_info::get_default_sysroot;
6-
use super::utils::{spawn_and_wait, spawn_and_wait_with_input, CargoProject, Compiler, LogGroup};
7-
use super::{CodegenBackend, SysrootKind};
81
use std::env;
92
use std::ffi::OsStr;
103
use std::fs;
114
use std::path::PathBuf;
125
use std::process::Command;
136

7+
use crate::build_sysroot;
8+
use crate::config;
9+
use crate::path::{Dirs, RelPath};
10+
use crate::prepare::{apply_patches, GitRepo};
11+
use crate::rustc_info::get_default_sysroot;
12+
use crate::utils::{spawn_and_wait, spawn_and_wait_with_input, CargoProject, Compiler, LogGroup};
13+
use crate::{CodegenBackend, SysrootKind};
14+
1415
static BUILD_EXAMPLE_OUT_DIR: RelPath = RelPath::BUILD.join("example");
1516

1617
struct TestCase {

build_system/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};
55
use std::process::{self, Command, Stdio};
66
use std::sync::atomic::{AtomicBool, Ordering};
77

8-
use super::path::{Dirs, RelPath};
8+
use crate::path::{Dirs, RelPath};
99

1010
#[derive(Clone, Debug)]
1111
pub(crate) struct Compiler {

0 commit comments

Comments
 (0)