Skip to content

Commit 4cf97fe

Browse files
authored
Auto merge of #34677 - alexcrichton:no-more-build-directory, r=brson
rustbuild: Remove the `build` directory The organization in rustbuild was a little odd at the moment where the `lib.rs` was quite small but the binary `main.rs` was much larger. Unfortunately as well there was a `build/` directory with the implementation of the build system, but this directory was ignored by GitHub on the file-search prompt which was a little annoying. This commit reorganizes rustbuild slightly where all the library files (the build system) is located directly inside of `src/bootstrap` and all the binaries now live in `src/bootstrap/bin` (they're small). Hopefully this should allow GitHub to index and allow navigating all the files while maintaining a relatively similar layout to the other libraries in `src/`.
2 parents 9c1783a + 48a07bf commit 4cf97fe

20 files changed

+909
-930
lines changed

src/bootstrap/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ path = "lib.rs"
99

1010
[[bin]]
1111
name = "bootstrap"
12-
path = "main.rs"
12+
path = "bin/main.rs"
1313

1414
[[bin]]
1515
name = "rustc"
16-
path = "rustc.rs"
16+
path = "bin/rustc.rs"
1717

1818
[[bin]]
1919
name = "rustdoc"
20-
path = "rustdoc.rs"
20+
path = "bin/rustdoc.rs"
2121

2222
[dependencies]
2323
build_helper = { path = "../build_helper" }

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

+1-13
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,10 @@
1818
#![deny(warnings)]
1919

2020
extern crate bootstrap;
21-
extern crate build_helper;
22-
extern crate cmake;
23-
extern crate filetime;
24-
extern crate gcc;
25-
extern crate getopts;
26-
extern crate libc;
27-
extern crate num_cpus;
28-
extern crate rustc_serialize;
29-
extern crate toml;
30-
extern crate md5;
3121

3222
use std::env;
3323

34-
use build::{Flags, Config, Build};
35-
36-
mod build;
24+
use bootstrap::{Flags, Config, Build};
3725

3826
fn main() {
3927
let args = env::args().skip(1).collect::<Vec<_>>();

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,14 @@ fn main() {
5353

5454
let rustc = env::var_os(rustc).unwrap();
5555
let libdir = env::var_os(libdir).unwrap();
56-
let mut dylib_path = bootstrap::dylib_path();
56+
let mut dylib_path = bootstrap::util::dylib_path();
5757
dylib_path.insert(0, PathBuf::from(libdir));
5858

5959
let mut cmd = Command::new(rustc);
6060
cmd.args(&args)
6161
.arg("--cfg").arg(format!("stage{}", stage))
62-
.env(bootstrap::dylib_path_var(), env::join_paths(&dylib_path).unwrap());
62+
.env(bootstrap::util::dylib_path_var(),
63+
env::join_paths(&dylib_path).unwrap());
6364

6465
if let Some(target) = target {
6566
// The stage0 compiler has a special sysroot distinct from what we

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ fn main() {
2323
let rustdoc = env::var_os("RUSTDOC_REAL").unwrap();
2424
let libdir = env::var_os("RUSTC_LIBDIR").unwrap();
2525

26-
let mut dylib_path = bootstrap::dylib_path();
26+
let mut dylib_path = bootstrap::util::dylib_path();
2727
dylib_path.insert(0, PathBuf::from(libdir));
2828

2929
let mut cmd = Command::new(rustdoc);
3030
cmd.args(&args)
3131
.arg("--cfg").arg(format!("stage{}", env::var("RUSTC_STAGE").unwrap()))
3232
.arg("--cfg").arg("dox")
33-
.env(bootstrap::dylib_path_var(), env::join_paths(&dylib_path).unwrap());
33+
.env(bootstrap::util::dylib_path_var(),
34+
env::join_paths(&dylib_path).unwrap());
3435
std::process::exit(match cmd.status() {
3536
Ok(s) => s.code().unwrap_or(1),
3637
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),

0 commit comments

Comments
 (0)