about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-12-29 18:17:31 -0800
committerAlex Crichton <alex@alexcrichton.com>2016-12-29 23:33:13 -0800
commite484197482698ee0bb83a66987a5f64c46ae306b (patch)
tree483907141a5dcd2cfc7e4ea91f7234d77bddf83b
parent3eb459ff5ff845cce0695e3eee3206303f72338b (diff)
downloadrust-e484197482698ee0bb83a66987a5f64c46ae306b.tar.gz
rust-e484197482698ee0bb83a66987a5f64c46ae306b.zip
A few small test fixes and such from rollup
-rw-r--r--src/bootstrap/compile.rs24
-rw-r--r--src/bootstrap/config.toml.example2
-rw-r--r--src/bootstrap/step.rs7
-rw-r--r--src/tools/cargotest/main.rs6
-rw-r--r--src/tools/compiletest/src/main.rs3
5 files changed, 26 insertions, 16 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 24e29225c6e..dcccf788935 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -35,16 +35,11 @@ use {Build, Compiler, Mode};
 /// created will also be linked into the sysroot directory.
 pub fn std(build: &Build, target: &str, compiler: &Compiler) {
     let libdir = build.sysroot_libdir(compiler, target);
-    let _ = fs::remove_dir_all(&libdir);
     t!(fs::create_dir_all(&libdir));
 
     println!("Building stage{} std artifacts ({} -> {})", compiler.stage,
              compiler.host, target);
 
-    // Some platforms have startup objects that may be required to produce the
-    // libstd dynamic library, for example.
-    build_startup_objects(build, target, &libdir);
-
     let out_dir = build.cargo_out(compiler, Mode::Libstd, target);
     build.clear_if_dirty(&out_dir, &build.compiler_path(compiler));
     let mut cargo = build.cargo(compiler, Mode::Libstd, target, "build");
@@ -111,12 +106,15 @@ fn copy_musl_third_party_objects(build: &Build, target: &str, into: &Path) {
 /// They don't require any library support as they're just plain old object
 /// files, so we just use the nightly snapshot compiler to always build them (as
 /// no other compilers are guaranteed to be available).
-fn build_startup_objects(build: &Build, target: &str, into: &Path) {
+pub fn build_startup_objects(build: &Build, for_compiler: &Compiler, target: &str) {
     if !target.contains("pc-windows-gnu") {
         return
     }
+
     let compiler = Compiler::new(0, &build.config.build);
     let compiler_path = build.compiler_path(&compiler);
+    let into = build.sysroot_libdir(for_compiler, target);
+    t!(fs::create_dir_all(&into));
 
     for file in t!(fs::read_dir(build.src.join("src/rtstartup"))) {
         let file = t!(file);
@@ -124,7 +122,7 @@ fn build_startup_objects(build: &Build, target: &str, into: &Path) {
         build.run(cmd.env("RUSTC_BOOTSTRAP", "1")
                      .arg("--target").arg(target)
                      .arg("--emit=obj")
-                     .arg("--out-dir").arg(into)
+                     .arg("--out-dir").arg(&into)
                      .arg(file.path()));
     }
 
@@ -155,6 +153,12 @@ pub fn test_link(build: &Build,
                  compiler: &Compiler,
                  target_compiler: &Compiler,
                  target: &str) {
+    println!("Copying stage{} test from stage{} ({} -> {} / {})",
+             target_compiler.stage,
+             compiler.stage,
+             compiler.host,
+             target_compiler.host,
+             target);
     let libdir = build.sysroot_libdir(&target_compiler, target);
     let out_dir = build.cargo_out(&compiler, Mode::Libtest, target);
     add_to_sysroot(&out_dir, &libdir);
@@ -224,6 +228,12 @@ pub fn rustc_link(build: &Build,
                   compiler: &Compiler,
                   target_compiler: &Compiler,
                   target: &str) {
+    println!("Copying stage{} rustc from stage{} ({} -> {} / {})",
+             target_compiler.stage,
+             compiler.stage,
+             compiler.host,
+             target_compiler.host,
+             target);
     let libdir = build.sysroot_libdir(&target_compiler, target);
     let out_dir = build.cargo_out(&compiler, Mode::Librustc, target);
     add_to_sysroot(&out_dir, &libdir);
diff --git a/src/bootstrap/config.toml.example b/src/bootstrap/config.toml.example
index b476478fdd1..69210c4959b 100644
--- a/src/bootstrap/config.toml.example
+++ b/src/bootstrap/config.toml.example
@@ -51,7 +51,7 @@
 # support. You'll need to write a target specification at least, and most
 # likely, teach rustc about the C ABI of the target. Get in touch with the
 # Rust team and file an issue if you need assistance in porting!
-#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc"
+#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX"
 
 # =============================================================================
 # General build configuration options
diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs
index 9c408024be3..7bcfb06f210 100644
--- a/src/bootstrap/step.rs
+++ b/src/bootstrap/step.rs
@@ -248,6 +248,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
                "libstd-link",
                "build-crate-std_shim",
                compile::std_link)
+        .dep(|s| s.name("startup-objects"))
         .dep(|s| s.name("create-sysroot").target(s.host));
     crate_rule(build,
                &mut rules,
@@ -264,6 +265,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
 
     for (krate, path, _default) in krates("std_shim") {
         rules.build(&krate.build_step, path)
+             .dep(|s| s.name("startup-objects"))
              .dep(move |s| s.name("rustc").host(&build.config.build).target(s.host))
              .run(move |s| compile::std(build, s.target, &s.compiler()));
     }
@@ -279,6 +281,10 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
              .run(move |s| compile::rustc(build, s.target, &s.compiler()));
     }
 
+    rules.build("startup-objects", "src/rtstartup")
+         .dep(|s| s.name("create-sysroot").target(s.host))
+         .run(move |s| compile::build_startup_objects(build, &s.compiler(), s.target));
+
     // ========================================================================
     // Test targets
     //
@@ -349,6 +355,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
         let mut suite = |name, path, mode, dir| {
             rules.test(name, path)
                  .dep(|s| s.name("librustc"))
+                 .dep(|s| s.name("test-helpers"))
                  .dep(|s| s.name("tool-compiletest").target(s.host))
                  .default(mode != "pretty")
                  .host(true)
diff --git a/src/tools/cargotest/main.rs b/src/tools/cargotest/main.rs
index 8c8e426604e..b4f4d179905 100644
--- a/src/tools/cargotest/main.rs
+++ b/src/tools/cargotest/main.rs
@@ -52,12 +52,6 @@ const TEST_REPOS: &'static [Test] = &[
         sha: "999001b223152441198f117a68fb81f57bc086dd",
         lock: None,
     },
-    Test {
-        name: "xsv",
-        repo: "https://github.com/BurntSushi/xsv",
-        sha: "5ec4fff4a3f507eda887049469897f02c6fae036",
-        lock: None,
-    },
 ];
 
 fn main() {
diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs
index f04e308d62f..dbfe1111846 100644
--- a/src/tools/compiletest/src/main.rs
+++ b/src/tools/compiletest/src/main.rs
@@ -271,8 +271,7 @@ pub fn run_tests(config: &Config) {
             Mode::Codegen |
             Mode::CodegenUnits |
             Mode::Pretty |
-            Mode::Rustdoc |
-            Mode::Incremental => {}
+            Mode::Rustdoc => {}
 
             _ => {
                 env::set_var("RUST_TEST_THREADS", "1");