diff --git a/.travis.yml b/.travis.yml index 19d5b2d7e05..0546f6827a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ git: submodules: false matrix: + fast_finish: true include: # Linux builders, all docker images - env: IMAGE=android DEPLOY=1 @@ -23,6 +24,7 @@ matrix: - env: IMAGE=dist-powerpc64-linux DEPLOY=1 - env: IMAGE=dist-s390x-linux-netbsd DEPLOY=1 - env: IMAGE=dist-x86-linux DEPLOY=1 + - env: IMAGE=emscripten - env: IMAGE=i686-gnu - env: IMAGE=i686-gnu-nopt - env: IMAGE=x86_64-gnu diff --git a/appveyor.yml b/appveyor.yml index 56ab8d98abd..b0eb2647454 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -73,6 +73,9 @@ environment: MINGW_DIR: mingw64 DEPLOY: 1 +matrix: + fast_finish: true + clone_depth: 1 build: false diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 0eeb799672c..079f93e7331 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -213,7 +213,11 @@ pub fn rustc(build: &Build, target: &str, compiler: &Compiler) { if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) { cargo.env("CFG_LLVM_ROOT", s); } - if build.config.llvm_static_stdcpp { + // Building with a static libstdc++ is only supported on linux right now, + // not for MSVC or OSX + if build.config.llvm_static_stdcpp && + !target.contains("windows") && + !target.contains("apple") { cargo.env("LLVM_STATIC_STDCPP", compiler_file(build.cxx(target), "libstdc++.a")); } diff --git a/src/ci/docker/cross/build-arm-musl.sh b/src/ci/docker/cross/build-arm-musl.sh index 989862b1b73..938e69834e4 100755 --- a/src/ci/docker/cross/build-arm-musl.sh +++ b/src/ci/docker/cross/build-arm-musl.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright 2017 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. @@ -13,16 +13,33 @@ set -ex MUSL=1.1.16 +hide_output() { + set +x + on_err=" +echo ERROR: An error was encountered with the build. +cat /tmp/build.log +exit 1 +" + trap "$on_err" ERR + bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & + PING_LOOP_PID=$! + $@ &> /tmp/build.log + trap - ERR + kill $PING_LOOP_PID + rm /tmp/build.log + set -x +} + curl -O https://www.musl-libc.org/releases/musl-$MUSL.tar.gz tar xf musl-$MUSL.tar.gz cd musl-$MUSL CC=arm-linux-gnueabi-gcc \ CFLAGS="-march=armv6 -marm" \ - ./configure \ + hide_output ./configure \ --prefix=/usr/local/arm-linux-musleabi \ --enable-wrapper=gcc -make -j$(nproc) -make install +hide_output make -j$(nproc) +hide_output make install cd .. rm -rf musl-$MUSL @@ -30,11 +47,11 @@ tar xf musl-$MUSL.tar.gz cd musl-$MUSL CC=arm-linux-gnueabihf-gcc \ CFLAGS="-march=armv6 -marm" \ - ./configure \ + hide_output ./configure \ --prefix=/usr/local/arm-linux-musleabihf \ --enable-wrapper=gcc -make -j$(nproc) -make install +hide_output make -j$(nproc) +hide_output make install cd .. rm -rf musl-$MUSL @@ -42,11 +59,11 @@ tar xf musl-$MUSL.tar.gz cd musl-$MUSL CC=arm-linux-gnueabihf-gcc \ CFLAGS="-march=armv7-a" \ - ./configure \ + hide_output ./configure \ --prefix=/usr/local/armv7-linux-musleabihf \ --enable-wrapper=gcc -make -j$(nproc) -make install +hide_output make -j$(nproc) +hide_output make install cd .. rm -rf musl-$MUSL* @@ -54,7 +71,6 @@ ln -nsf ../arm-linux-musleabi/bin/musl-gcc /usr/local/bin/arm-linux-musleabi-gcc ln -nsf ../arm-linux-musleabihf/bin/musl-gcc /usr/local/bin/arm-linux-musleabihf-gcc ln -nsf ../armv7-linux-musleabihf/bin/musl-gcc /usr/local/bin/armv7-linux-musleabihf-gcc - curl -L https://github.com/llvm-mirror/llvm/archive/release_39.tar.gz | tar xzf - curl -L https://github.com/llvm-mirror/libunwind/archive/release_39.tar.gz | tar xzf - diff --git a/src/ci/docker/cross/build-rumprun.sh b/src/ci/docker/cross/build-rumprun.sh index d0ef0e55db1..59b1c9b6415 100755 --- a/src/ci/docker/cross/build-rumprun.sh +++ b/src/ci/docker/cross/build-rumprun.sh @@ -28,7 +28,6 @@ exit 1 set -x } - git clone https://github.com/rumpkernel/rumprun cd rumprun git reset --hard 39a97f37a85e44c69b662f6b97b688fbe892603b diff --git a/src/ci/docker/dist-arm-linux/Dockerfile b/src/ci/docker/dist-arm-linux/Dockerfile index 956969684b4..03ca4c28078 100644 --- a/src/ci/docker/dist-arm-linux/Dockerfile +++ b/src/ci/docker/dist-arm-linux/Dockerfile @@ -58,22 +58,8 @@ RUN mkdir /x-tools && chown rustbuild:rustbuild /x-tools USER rustbuild WORKDIR /tmp -COPY arm-linux-gnueabi.config /tmp/ -RUN mkdir build && \ - cd build && \ - cp ../arm-linux-gnueabi.config .config && \ - ct-ng oldconfig && \ - ct-ng build && \ - cd .. && \ - rm -rf build -COPY arm-linux-gnueabihf.config /tmp/ -RUN mkdir build && \ - cd build && \ - cp ../arm-linux-gnueabihf.config .config && \ - ct-ng oldconfig && \ - ct-ng build && \ - cd .. && \ - rm -rf build +COPY arm-linux-gnueabihf.config arm-linux-gnueabi.config build-toolchains.sh /tmp/ +RUN ./build-toolchains.sh USER root diff --git a/src/ci/docker/dist-arm-linux/build-toolchains.sh b/src/ci/docker/dist-arm-linux/build-toolchains.sh new file mode 100755 index 00000000000..ed1406bd7cf --- /dev/null +++ b/src/ci/docker/dist-arm-linux/build-toolchains.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright 2017 The Rust Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution and at +# http://rust-lang.org/COPYRIGHT. +# +# Licensed under the Apache License, Version 2.0 or the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + +set -ex + +hide_output() { + set +x + on_err=" +echo ERROR: An error was encountered with the build. +cat /tmp/build.log +exit 1 +" + trap "$on_err" ERR + bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & + PING_LOOP_PID=$! + $@ &> /tmp/build.log + rm /tmp/build.log + trap - ERR + kill $PING_LOOP_PID + set -x +} + +mkdir build +cd build +cp ../arm-linux-gnueabi.config .config +ct-ng oldconfig +hide_output ct-ng build +cd .. +rm -rf build + +mkdir build +cd build +cp ../arm-linux-gnueabihf.config .config +ct-ng oldconfig +hide_output ct-ng build +cd .. +rm -rf build diff --git a/src/ci/docker/dist-armv7-aarch64-linux/Dockerfile b/src/ci/docker/dist-armv7-aarch64-linux/Dockerfile index 2070ed47eb7..93d9e004c8c 100644 --- a/src/ci/docker/dist-armv7-aarch64-linux/Dockerfile +++ b/src/ci/docker/dist-armv7-aarch64-linux/Dockerfile @@ -59,21 +59,8 @@ USER rustbuild WORKDIR /tmp COPY armv7-linux-gnueabihf.config /tmp/ -RUN mkdir build && \ - cd build && \ - cp ../armv7-linux-gnueabihf.config .config && \ - ct-ng oldconfig && \ - ct-ng build && \ - cd .. && \ - rm -rf build -COPY aarch64-linux-gnu.config /tmp/ -RUN mkdir build && \ - cd build && \ - cp ../aarch64-linux-gnu.config .config && \ - ct-ng oldconfig && \ - ct-ng build && \ - cd .. && \ - rm -rf build +COPY armv7-linux-gnueabihf.config aarch64-linux-gnu.config build-toolchains.sh /tmp/ +RUN ./build-toolchains.sh USER root diff --git a/src/ci/docker/dist-armv7-aarch64-linux/build-toolchains.sh b/src/ci/docker/dist-armv7-aarch64-linux/build-toolchains.sh new file mode 100755 index 00000000000..ebd5ef4cfc4 --- /dev/null +++ b/src/ci/docker/dist-armv7-aarch64-linux/build-toolchains.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright 2017 The Rust Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution and at +# http://rust-lang.org/COPYRIGHT. +# +# Licensed under the Apache License, Version 2.0 or the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + +set -ex + +hide_output() { + set +x + on_err=" +echo ERROR: An error was encountered with the build. +cat /tmp/build.log +exit 1 +" + trap "$on_err" ERR + bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & + PING_LOOP_PID=$! + $@ &> /tmp/build.log + rm /tmp/build.log + trap - ERR + kill $PING_LOOP_PID + set -x +} + +mkdir build +cd build +cp ../armv7-linux-gnueabihf.config .config +ct-ng oldconfig +hide_output ct-ng build +cd .. +rm -rf build + +mkdir build +cd build +cp ../aarch64-linux-gnu.config .config +ct-ng oldconfig +hide_output ct-ng build +cd .. +rm -rf build diff --git a/src/ci/docker/emscripten/build-emscripten.sh b/src/ci/docker/emscripten/build-emscripten.sh index 2ce7a58ae66..88bf583007c 100755 --- a/src/ci/docker/emscripten/build-emscripten.sh +++ b/src/ci/docker/emscripten/build-emscripten.sh @@ -11,9 +11,26 @@ set -ex +hide_output() { + set +x + on_err=" +echo ERROR: An error was encountered with the build. +cat /tmp/build.log +exit 1 +" + trap "$on_err" ERR + bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & + PING_LOOP_PID=$! + $@ &> /tmp/build.log + trap - ERR + kill $PING_LOOP_PID + rm /tmp/build.log + set -x +} + curl https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \ tar xzf - source emsdk_portable/emsdk_env.sh -emsdk update -emsdk install --build=Release sdk-tag-1.37.1-32bit -emsdk activate --build=Release sdk-tag-1.37.1-32bit +hide_output emsdk update +hide_output emsdk install --build=Release sdk-tag-1.37.1-32bit +hide_output emsdk activate --build=Release sdk-tag-1.37.1-32bit diff --git a/src/ci/docker/linux-tested-targets/Dockerfile b/src/ci/docker/linux-tested-targets/Dockerfile index 2a43201ed0a..7f95e17c709 100644 --- a/src/ci/docker/linux-tested-targets/Dockerfile +++ b/src/ci/docker/linux-tested-targets/Dockerfile @@ -32,10 +32,10 @@ ENV RUST_CONFIGURE_ARGS \ --musl-root-x86_64=/musl-x86_64 \ --musl-root-i686=/musl-i686 +# FIXME should also test i686-unknown-linux-musl ENV SCRIPT \ python2.7 ../x.py test \ --target x86_64-unknown-linux-musl \ - --target i686-unknown-linux-musl \ --target i586-unknown-linux-gnu \ && \ python2.7 ../x.py dist \ diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs index 9e5391ebd82..b3a2d66a07c 100644 --- a/src/librustc_trans/back/write.rs +++ b/src/librustc_trans/back/write.rs @@ -668,7 +668,8 @@ pub fn run_passes(sess: &Session, // Sanity check assert!(trans.modules.len() == sess.opts.cg.codegen_units || sess.opts.debugging_opts.incremental.is_some() || - !sess.opts.output_types.should_trans()); + !sess.opts.output_types.should_trans() || + sess.opts.debugging_opts.no_trans); let tm = create_target_machine(sess); diff --git a/src/test/run-pass/sse2.rs b/src/test/run-pass/sse2.rs index 7e42698d496..8d88c17af79 100644 --- a/src/test/run-pass/sse2.rs +++ b/src/test/run-pass/sse2.rs @@ -13,10 +13,14 @@ use std::env; fn main() { - // Skip this tests on i586-unknown-linux-gnu where sse2 is disabled - let real_target = env::var("TARGET").unwrap(); - if real_target.contains("i586") { - return + match env::var("TARGET") { + Ok(s) => { + // Skip this tests on i586-unknown-linux-gnu where sse2 is disabled + if s.contains("i586") { + return + } + } + Err(_) => return, } if cfg!(any(target_arch = "x86", target_arch = "x86_64")) { assert!(cfg!(target_feature = "sse2"),