about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2016-10-19 08:00:00 +0300
committerGitHub <noreply@github.com>2016-10-19 08:00:00 +0300
commitfc8f9b950b93dc6a7b9e3945b7b36ded64a64e04 (patch)
tree47aa4b4d3bfbf6fa781cfaf44ca11936611a807a /src
parent5c643435d157f7cd20f50a01fe246373970b3098 (diff)
parent06d173adb76e3f5f30c168a4c48316823b08e650 (diff)
Rollup merge of #37182 - alexcrichton:appveyor, r=brson
Add AppVeyor configuration to the repo

We hope to move to AppVeyor in the near future off of Buildbot + EC2. This adds
an `appveyor.yml` configuration file which is ready to run builds on the auto
branch. This is also accompanied with a few minor fixes to the build system and
such to accomodate AppVeyor.

The intention is that we're not switching over to AppVeyor entirely just yet,
but rather we'll watch the builds for a week or so. If everything checks out
then we'll start gating on AppVeyor instead of Buildbot!
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/config.rs2
-rw-r--r--src/bootstrap/config.toml.example3
-rw-r--r--src/bootstrap/native.rs25
-rw-r--r--src/rustllvm/llvm-auto-clean-trigger2
-rw-r--r--src/test/run-make/tools.mk3
-rw-r--r--src/tools/cargotest/main.rs14
-rw-r--r--src/tools/compiletest/src/runtest.rs5
7 files changed, 41 insertions, 13 deletions
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index 6158e94875e..e4577bfcdfc 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -120,6 +120,7 @@ struct Build {
     rustc: Option<String>,
     compiler_docs: Option<bool>,
     docs: Option<bool>,
+    submodules: Option<bool>,
 }
 
 /// TOML representation of how the LLVM build is configured.
@@ -225,6 +226,7 @@ impl Config {
         config.cargo = build.cargo.map(PathBuf::from);
         set(&mut config.compiler_docs, build.compiler_docs);
         set(&mut config.docs, build.docs);
+        set(&mut config.submodules, build.submodules);
 
         if let Some(ref llvm) = toml.llvm {
             set(&mut config.ccache, llvm.ccache);
diff --git a/src/bootstrap/config.toml.example b/src/bootstrap/config.toml.example
index f054b29d0b1..39c976edc13 100644
--- a/src/bootstrap/config.toml.example
+++ b/src/bootstrap/config.toml.example
@@ -76,6 +76,9 @@
 # library and facade crates.
 #compiler-docs = false
 
+# Indicate whether submodules are managed and updated automatically.
+#submodules = true
+
 # =============================================================================
 # Options for compiling Rust code itself
 # =============================================================================
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
index 63fc59e4328..1b4e86fb30f 100644
--- a/src/bootstrap/native.rs
+++ b/src/bootstrap/native.rs
@@ -18,9 +18,10 @@
 //! LLVM and compiler-rt are essentially just wired up to everything else to
 //! ensure that they're always in place if needed.
 
+use std::fs::{self, File};
+use std::io::{Read, Write};
 use std::path::Path;
 use std::process::Command;
-use std::fs::{self, File};
 
 use build_helper::output;
 use cmake;
@@ -43,11 +44,17 @@ pub fn llvm(build: &Build, target: &str) {
     // artifacts are missing) then we keep going, otherwise we bail out.
     let dst = build.llvm_out(target);
     let stamp = build.src.join("src/rustllvm/llvm-auto-clean-trigger");
+    let mut stamp_contents = String::new();
+    t!(t!(File::open(&stamp)).read_to_string(&mut stamp_contents));
     let done_stamp = dst.join("llvm-finished-building");
-    build.clear_if_dirty(&dst, &stamp);
-    if fs::metadata(&done_stamp).is_ok() {
-        return
+    if done_stamp.exists() {
+        let mut done_contents = String::new();
+        t!(t!(File::open(&done_stamp)).read_to_string(&mut done_contents));
+        if done_contents == stamp_contents {
+            return
+        }
     }
+    drop(fs::remove_dir_all(&dst));
 
     println!("Building LLVM for {}", target);
 
@@ -73,7 +80,9 @@ pub fn llvm(build: &Build, target: &str) {
        .define("WITH_POLLY", "OFF")
        .define("LLVM_ENABLE_TERMINFO", "OFF")
        .define("LLVM_ENABLE_LIBEDIT", "OFF")
-       .define("LLVM_PARALLEL_COMPILE_JOBS", build.jobs().to_string());
+       .define("LLVM_PARALLEL_COMPILE_JOBS", build.jobs().to_string())
+       .define("LLVM_TARGET_ARCH", target.split('-').next().unwrap())
+       .define("LLVM_DEFAULT_TARGET_TRIPLE", target);
 
     if target.starts_with("i686") {
         cfg.define("LLVM_BUILD_32_BITS", "ON");
@@ -86,9 +95,7 @@ pub fn llvm(build: &Build, target: &str) {
         //        actually exists most of the time in normal installs of LLVM.
         let host = build.llvm_out(&build.config.build).join("bin/llvm-tblgen");
         cfg.define("CMAKE_CROSSCOMPILING", "True")
-           .define("LLVM_TARGET_ARCH", target.split('-').next().unwrap())
-           .define("LLVM_TABLEGEN", &host)
-           .define("LLVM_DEFAULT_TARGET_TRIPLE", target);
+           .define("LLVM_TABLEGEN", &host);
     }
 
     // MSVC handles compiler business itself
@@ -114,7 +121,7 @@ pub fn llvm(build: &Build, target: &str) {
     //        tools and libs on all platforms.
     cfg.build();
 
-    t!(File::create(&done_stamp));
+    t!(t!(File::create(&done_stamp)).write_all(stamp_contents.as_bytes()));
 }
 
 fn check_llvm_version(build: &Build, llvm_config: &Path) {
diff --git a/src/rustllvm/llvm-auto-clean-trigger b/src/rustllvm/llvm-auto-clean-trigger
index b12e25bba69..f4b5ca7a157 100644
--- a/src/rustllvm/llvm-auto-clean-trigger
+++ b/src/rustllvm/llvm-auto-clean-trigger
@@ -1,4 +1,4 @@
 # If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
 # The actual contents of this file do not matter, but to trigger a change on the
 # build bots then the contents should be changed so git updates the mtime.
-2016-10-10
+2016-10-10b
diff --git a/src/test/run-make/tools.mk b/src/test/run-make/tools.mk
index 38afa42a293..1db87d474bd 100644
--- a/src/test/run-make/tools.mk
+++ b/src/test/run-make/tools.mk
@@ -22,9 +22,6 @@ RLIB_GLOB = lib$(1)*.rlib
 BIN = $(1)
 
 UNAME = $(shell uname)
-ifneq (,$(findstring MINGW,$(UNAME)))
-IS_WINDOWS=1
-endif
 
 ifeq ($(UNAME),Darwin)
 RUN = $(TARGET_RPATH_ENV) $(RUN_BINFILE)
diff --git a/src/tools/cargotest/main.rs b/src/tools/cargotest/main.rs
index 633ff6271b7..978e991d508 100644
--- a/src/tools/cargotest/main.rs
+++ b/src/tools/cargotest/main.rs
@@ -36,6 +36,20 @@ const TEST_REPOS: &'static [Test] = &[Test {
 
 
 fn main() {
+    // One of the projects being tested here is Cargo, and when being tested
+    // Cargo will at some point call `nmake.exe` on Windows MSVC. Unfortunately
+    // `nmake` will read these two environment variables below and try to
+    // intepret them. We're likely being run, however, from MSYS `make` which
+    // uses the same variables.
+    //
+    // As a result, to prevent confusion and errors, we remove these variables
+    // from our environment to prevent passing MSYS make flags to nmake, causing
+    // it to blow up.
+    if cfg!(target_env = "msvc") {
+        env::remove_var("MAKE");
+        env::remove_var("MAKEFLAGS");
+    }
+
     let args = env::args().collect::<Vec<_>>();
     let ref cargo = args[1];
     let out_dir = Path::new(&args[2]);
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 35b93392baf..e10420bf291 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -2105,12 +2105,17 @@ actual:\n\
                                                  .collect::<Vec<_>>().join(" ");
 
             cmd.env("IS_MSVC", "1")
+               .env("IS_WINDOWS", "1")
                .env("MSVC_LIB", format!("'{}' -nologo", lib.display()))
                .env("CC", format!("'{}' {}", self.config.cc, cflags))
                .env("CXX", &self.config.cxx);
         } else {
             cmd.env("CC", format!("{} {}", self.config.cc, self.config.cflags))
                .env("CXX", format!("{} {}", self.config.cxx, self.config.cflags));
+
+            if self.config.target.contains("windows") {
+                cmd.env("IS_WINDOWS", "1");
+            }
         }
 
         let output = cmd.output().expect("failed to spawn `make`");