about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-09-30 01:21:55 +0000
committerbors <bors@rust-lang.org>2015-09-30 01:21:55 +0000
commit15db6ec5714dffab7b36db44de9ece5e76301e04 (patch)
treeac0cc52e908ae5dcd6677ed836d8048862633f85 /src
parent65d5c083377645a115c4ac23a620d3581b9562b6 (diff)
parent27dd6dd3dbe92debaac7d54c8405a3d3af1c4daf (diff)
Auto merge of #28500 - alexcrichton:docker-travis, r=brson
Travis CI has new infrastructure using the Google Compute Engine which has both
faster CPUs and more memory, and we've been encouraged to switch as it should
help our build times! The only downside currently, however, is that IPv6 is
disabled, causing a number of standard library tests to fail.

Consequently this commit tweaks our travis config in a few ways:

* ccache is disabled as it's not working on GCE just yet
* Docker is used to run tests inside which reportedly will get IPv6 working
* A system LLVM installation is used instead of building LLVM itself. This is
  primarily done to reduce build times, but we want automation for this sort of
  behavior anyway and we can extend this in the future with building from source
  as well if needed.
* gcc-specific logic is removed as the docker image for Ubuntu gives us a
  recent-enough gcc by default.
Diffstat (limited to 'src')
-rw-r--r--src/etc/Dockerfile12
-rw-r--r--src/libstd/net/udp.rs9
-rw-r--r--src/libstd/process.rs13
-rw-r--r--src/libstd/sys/unix/process.rs33
m---------src/llvm0
-rw-r--r--src/rustllvm/RustWrapper.cpp5
-rw-r--r--src/test/run-pass/core-run-destroy.rs36
7 files changed, 63 insertions, 45 deletions
diff --git a/src/etc/Dockerfile b/src/etc/Dockerfile
new file mode 100644
index 00000000000..69c5e151f18
--- /dev/null
+++ b/src/etc/Dockerfile
@@ -0,0 +1,12 @@
+FROM ubuntu:latest
+
+RUN echo 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main' | \
+        sudo tee -a /etc/apt/sources.list
+RUN echo 'deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main' | \
+        sudo tee -a /etc/apt/sources.list
+RUN apt-get update
+RUN apt-get -y install curl make g++ python2.7 git zlib1g-dev libedit-dev
+RUN apt-get -y --force-yes install llvm-3.7-tools
+
+RUN mkdir /build
+WORKDIR /build
diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs
index 9e4d38e4615..0d3d15401fd 100644
--- a/src/libstd/net/udp.rs
+++ b/src/libstd/net/udp.rs
@@ -185,14 +185,13 @@ mod tests {
         }
     }
 
-    // FIXME #11530 this fails on android because tests are run as root
-    #[cfg_attr(any(windows, target_os = "android"), ignore)]
     #[test]
     fn bind_error() {
-        let addr = SocketAddrV4::new(Ipv4Addr::new(0, 0, 0, 0), 1);
-        match UdpSocket::bind(&addr) {
+        match UdpSocket::bind("1.1.1.1:9999") {
             Ok(..) => panic!(),
-            Err(e) => assert_eq!(e.kind(), ErrorKind::PermissionDenied),
+            Err(e) => {
+                assert_eq!(e.kind(), ErrorKind::AddrNotAvailable)
+            }
         }
     }
 
diff --git a/src/libstd/process.rs b/src/libstd/process.rs
index 5f5d5a69003..0be751be950 100644
--- a/src/libstd/process.rs
+++ b/src/libstd/process.rs
@@ -625,17 +625,20 @@ mod tests {
         drop(p.wait());
     }
 
+    #[cfg(unix)]
     #[cfg(all(unix, not(target_os="android")))]
-    #[test]
     fn signal_reported_right() {
         use os::unix::process::ExitStatusExt;
 
-        let p = Command::new("/bin/sh").arg("-c").arg("kill -9 $$").spawn();
-        assert!(p.is_ok());
-        let mut p = p.unwrap();
+        let mut p = Command::new("/bin/sh")
+                            .arg("-c").arg("read a")
+                            .stdin(Stdio::piped())
+                            .spawn().unwrap();
+        p.kill().unwrap();
         match p.wait().unwrap().signal() {
             Some(9) => {},
-            result => panic!("not terminated by signal 9 (instead, {:?})", result),
+            result => panic!("not terminated by signal 9 (instead, {:?})",
+                             result),
         }
     }
 
diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs
index ce6e5609ce7..7f50e75f6fc 100644
--- a/src/libstd/sys/unix/process.rs
+++ b/src/libstd/sys/unix/process.rs
@@ -450,6 +450,15 @@ mod tests {
     use slice;
     use sys::{self, c, cvt, pipe};
 
+    macro_rules! t {
+        ($e:expr) => {
+            match $e {
+                Ok(t) => t,
+                Err(e) => panic!("received error for `{}`: {}", stringify!($e), e),
+            }
+        }
+    }
+
     #[cfg(not(target_os = "android"))]
     extern {
         #[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")]
@@ -473,24 +482,26 @@ mod tests {
         unsafe {
             // Test to make sure that a signal mask does not get inherited.
             let cmd = Command::new(OsStr::new("cat"));
-            let (stdin_read, stdin_write) = sys::pipe::anon_pipe().unwrap();
-            let (stdout_read, stdout_write) = sys::pipe::anon_pipe().unwrap();
+            let (stdin_read, stdin_write) = t!(sys::pipe::anon_pipe());
+            let (stdout_read, stdout_write) = t!(sys::pipe::anon_pipe());
 
             let mut set: c::sigset_t = mem::uninitialized();
             let mut old_set: c::sigset_t = mem::uninitialized();
-            cvt(c::sigemptyset(&mut set)).unwrap();
-            cvt(sigaddset(&mut set, libc::SIGINT)).unwrap();
-            cvt(c::pthread_sigmask(c::SIG_SETMASK, &set, &mut old_set)).unwrap();
+            t!(cvt(c::sigemptyset(&mut set)));
+            t!(cvt(sigaddset(&mut set, libc::SIGINT)));
+            t!(cvt(c::pthread_sigmask(c::SIG_SETMASK, &set, &mut old_set)));
 
-            let cat = Process::spawn(&cmd, Stdio::Raw(stdin_read.raw()),
-                                           Stdio::Raw(stdout_write.raw()),
-                                           Stdio::None).unwrap();
+            let cat = t!(Process::spawn(&cmd, Stdio::Raw(stdin_read.raw()),
+                                              Stdio::Raw(stdout_write.raw()),
+                                              Stdio::None));
             drop(stdin_read);
             drop(stdout_write);
 
-            cvt(c::pthread_sigmask(c::SIG_SETMASK, &old_set, ptr::null_mut())).unwrap();
+            t!(cvt(c::pthread_sigmask(c::SIG_SETMASK, &old_set,
+                                      ptr::null_mut())));
 
-            cvt(libc::funcs::posix88::signal::kill(cat.id() as libc::pid_t, libc::SIGINT)).unwrap();
+            t!(cvt(libc::funcs::posix88::signal::kill(cat.id() as libc::pid_t,
+                                                      libc::SIGINT)));
             // We need to wait until SIGINT is definitely delivered. The
             // easiest way is to write something to cat, and try to read it
             // back: if SIGINT is unmasked, it'll get delivered when cat is
@@ -504,7 +515,7 @@ mod tests {
                 assert!(ret == 0);
             }
 
-            cat.wait().unwrap();
+            t!(cat.wait());
         }
     }
 }
diff --git a/src/llvm b/src/llvm
-Subproject 3c88bf78f97d2cd8130b16eecb0eeb84888cd49
+Subproject 62ad301a2407a7aca50c1d5120c63597d676d29
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 5007af0e777..9ce34c40730 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -951,10 +951,5 @@ LLVMRustBuildLandingPad(LLVMBuilderRef Builder,
                         unsigned NumClauses,
                         const char* Name,
                         LLVMValueRef F) {
-#if LLVM_VERSION_MINOR >= 7
-    unwrap<Function>(F)->setPersonalityFn(unwrap<Constant>(PersFn));
-    return LLVMBuildLandingPad(Builder, Ty, NumClauses, Name);
-#else
     return LLVMBuildLandingPad(Builder, Ty, PersFn, NumClauses, Name);
-#endif
 }
diff --git a/src/test/run-pass/core-run-destroy.rs b/src/test/run-pass/core-run-destroy.rs
index 83ce0db365f..d6b6d673ca5 100644
--- a/src/test/run-pass/core-run-destroy.rs
+++ b/src/test/run-pass/core-run-destroy.rs
@@ -30,26 +30,25 @@ macro_rules! t {
     ($e:expr) => (match $e { Ok(e) => e, Err(e) => panic!("error: {}", e) })
 }
 
+#[test]
 fn test_destroy_once() {
     let mut p = sleeper();
-    match p.kill() {
-        Ok(()) => {}
-        Err(e) => panic!("error: {}", e),
-    }
+    t!(p.kill());
 }
 
 #[cfg(unix)]
 pub fn sleeper() -> Child {
-    Command::new("sleep").arg("1000").spawn().unwrap()
+    t!(Command::new("sleep").arg("1000").spawn())
 }
 #[cfg(windows)]
 pub fn sleeper() -> Child {
     // There's a `timeout` command on windows, but it doesn't like having
     // its output piped, so instead just ping ourselves a few times with
     // gaps in between so we're sure this process is alive for awhile
-    Command::new("ping").arg("127.0.0.1").arg("-n").arg("1000").spawn().unwrap()
+    t!(Command::new("ping").arg("127.0.0.1").arg("-n").arg("1000").spawn())
 }
 
+#[test]
 fn test_destroy_twice() {
     let mut p = sleeper();
     t!(p.kill()); // this shouldn't crash...
@@ -58,21 +57,20 @@ fn test_destroy_twice() {
 
 #[test]
 fn test_destroy_actually_kills() {
-    #[cfg(all(unix,not(target_os="android")))]
-    static BLOCK_COMMAND: &'static str = "cat";
-
-    #[cfg(all(unix,target_os="android"))]
-    static BLOCK_COMMAND: &'static str = "/system/bin/cat";
-
-    #[cfg(windows)]
-    static BLOCK_COMMAND: &'static str = "cmd";
+    let cmd = if cfg!(windows) {
+        "cmd"
+    } else if cfg!(target_os = "android") {
+        "/system/bin/cat"
+    } else {
+        "cat"
+    };
 
     // this process will stay alive indefinitely trying to read from stdin
-    let mut p = Command::new(BLOCK_COMMAND)
-                        .stdin(Stdio::piped())
-                        .spawn().unwrap();
+    let mut p = t!(Command::new(cmd)
+                           .stdin(Stdio::piped())
+                           .spawn());
 
-    p.kill().unwrap();
+    t!(p.kill());
 
     // Don't let this test time out, this should be quick
     let (tx, rx) = channel();
@@ -82,7 +80,7 @@ fn test_destroy_actually_kills() {
             process::exit(1);
         }
     });
-    let code = p.wait().unwrap().code();
+    let code = t!(p.wait()).code();
     if cfg!(windows) {
         assert!(code.is_some());
     } else {