Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustbuild: Quickly dist cross-host compilers #38731

Merged
merged 1 commit into from
Jan 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ matrix:
# Linux builders, all docker images
- env: IMAGE=arm-android
- env: IMAGE=cross
- env: IMAGE=dist-arm-unknown-linux-gnueabi
- env: IMAGE=dist-x86_64-unknown-freebsd
- env: IMAGE=i686-gnu
- env: IMAGE=i686-gnu-nopt
- env: IMAGE=x86_64-freebsd
- env: IMAGE=x86_64-gnu
- env: IMAGE=x86_64-gnu-full-bootstrap
- env: IMAGE=x86_64-gnu-aux
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@ version = "0.0.0"
[lib]
name = "bootstrap"
path = "lib.rs"
doctest = false

[[bin]]
name = "bootstrap"
path = "bin/main.rs"
test = false

[[bin]]
name = "rustc"
path = "bin/rustc.rs"
test = false

[[bin]]
name = "rustdoc"
path = "bin/rustdoc.rs"
test = false

[dependencies]
build_helper = { path = "../build_helper" }
Expand Down
11 changes: 11 additions & 0 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,3 +568,14 @@ pub fn distcheck(build: &Build) {
.arg("check")
.current_dir(&dir));
}

/// Test the build system itself
pub fn bootstrap(build: &Build) {
let mut cmd = Command::new(&build.cargo);
cmd.arg("test")
.current_dir(build.src.join("src/bootstrap"))
.env("CARGO_TARGET_DIR", build.out.join("bootstrap"))
.env("RUSTC", &build.rustc);
cmd.arg("--").args(&build.flags.cmd.test_args());
build.run(&mut cmd);
}
7 changes: 1 addition & 6 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,9 @@ pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
}

/// Creates the `rust-src` installer component and the plain source tarball
pub fn rust_src(build: &Build, host: &str) {
pub fn rust_src(build: &Build) {
println!("Dist src");

if host != build.config.build {
println!("\tskipping, not a build host");
return
}

let plain_name = format!("rustc-{}-src", package_vers(build));
let name = format!("rust-src-{}", package_vers(build));
let image = tmpdir(build).join(format!("{}-image", name));
Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ pub fn rustbook(build: &Build, target: &str, name: &str) {
/// `STAMP` alongw ith providing the various header/footer HTML we've cutomized.
///
/// In the end, this is just a glorified wrapper around rustdoc!
pub fn standalone(build: &Build, stage: u32, target: &str) {
println!("Documenting stage{} standalone ({})", stage, target);
pub fn standalone(build: &Build, target: &str) {
println!("Documenting standalone ({})", target);
let out = build.doc_out(target);
t!(fs::create_dir_all(&out));

let compiler = Compiler::new(stage, &build.config.build);
let compiler = Compiler::new(0, &build.config.build);

let favicon = build.src.join("src/doc/favicon.inc");
let footer = build.src.join("src/doc/footer.inc");
Expand Down
Loading