Skip to content

Commit 52ec2e5

Browse files
committed
reorganize bootstrap bins and helper module utilizations
Signed-off-by: onur-ozkan <[email protected]>
1 parent 91db3bd commit 52ec2e5

File tree

5 files changed

+20
-35
lines changed

5 files changed

+20
-35
lines changed

src/bootstrap/bin/_helper.rs

-24
This file was deleted.
File renamed without changes.

src/bootstrap/bin/rustc.rs renamed to src/bootstrap/src/bin/rustc.rs

+11-6
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,25 @@
1515
//! switching compilers for the bootstrap and for build scripts will probably
1616
//! never get replaced.
1717
18-
include!("../dylib_util.rs");
19-
include!("./_helper.rs");
20-
2118
use std::env;
2219
use std::path::PathBuf;
23-
use std::process::{exit, Child, Command};
20+
use std::process::{Child, Command};
2421
use std::time::Instant;
2522

23+
use dylib_util::{dylib_path, dylib_path_var};
24+
25+
#[path = "../utils/bin_helpers.rs"]
26+
mod bin_helpers;
27+
28+
#[path = "../utils/dylib_util.rs"]
29+
mod dylib_util;
30+
2631
fn main() {
2732
let args = env::args_os().skip(1).collect::<Vec<_>>();
2833
let arg = |name| args.windows(2).find(|args| args[0] == name).and_then(|args| args[1].to_str());
2934

30-
let stage = parse_rustc_stage();
31-
let verbose = parse_rustc_verbose();
35+
let stage = bin_helpers::parse_rustc_stage();
36+
let verbose = bin_helpers::parse_rustc_verbose();
3237

3338
// Detect whether or not we're a build script depending on whether --target
3439
// is passed (a bit janky...)

src/bootstrap/bin/rustdoc.rs renamed to src/bootstrap/src/bin/rustdoc.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,21 @@
55
use std::env;
66
use std::ffi::OsString;
77
use std::path::PathBuf;
8-
use std::process::{exit, Command};
8+
use std::process::Command;
99

10-
include!("../dylib_util.rs");
10+
use dylib_util::{dylib_path, dylib_path_var};
1111

12-
include!("./_helper.rs");
12+
#[path = "../utils/bin_helpers.rs"]
13+
mod bin_helpers;
14+
15+
#[path = "../utils/dylib_util.rs"]
16+
mod dylib_util;
1317

1418
fn main() {
1519
let args = env::args_os().skip(1).collect::<Vec<_>>();
1620

17-
let stage = parse_rustc_stage();
18-
let verbose = parse_rustc_verbose();
21+
let stage = bin_helpers::parse_rustc_stage();
22+
let verbose = bin_helpers::parse_rustc_verbose();
1923

2024
let rustdoc = env::var_os("RUSTDOC_REAL").expect("RUSTDOC_REAL was not set");
2125
let libdir = env::var_os("RUSTDOC_LIBDIR").expect("RUSTDOC_LIBDIR was not set");

0 commit comments

Comments
 (0)