Skip to content

Commit

Permalink
More test fixes from rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Jan 20, 2017
1 parent 5e8d7a4 commit 72c3148
Show file tree
Hide file tree
Showing 13 changed files with 162 additions and 53 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ git:
submodules: false

matrix:
fast_finish: true
include:
# Linux builders, all docker images
- env: IMAGE=android DEPLOY=1
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ environment:
MINGW_DIR: mingw64
DEPLOY: 1

matrix:
fast_finish: true

clone_depth: 1
build: false

Expand Down
6 changes: 5 additions & 1 deletion src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down
38 changes: 27 additions & 11 deletions src/ci/docker/cross/build-arm-musl.sh
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -13,48 +13,64 @@ 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

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

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*

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 -

Expand Down
1 change: 0 additions & 1 deletion src/ci/docker/cross/build-rumprun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ exit 1
set -x
}


git clone https://github.com/rumpkernel/rumprun
cd rumprun
git reset --hard 39a97f37a85e44c69b662f6b97b688fbe892603b
Expand Down
18 changes: 2 additions & 16 deletions src/ci/docker/dist-arm-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
45 changes: 45 additions & 0 deletions src/ci/docker/dist-arm-linux/build-toolchains.sh
Original file line number Diff line number Diff line change
@@ -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 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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
17 changes: 2 additions & 15 deletions src/ci/docker/dist-armv7-aarch64-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
45 changes: 45 additions & 0 deletions src/ci/docker/dist-armv7-aarch64-linux/build-toolchains.sh
Original file line number Diff line number Diff line change
@@ -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 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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
23 changes: 20 additions & 3 deletions src/ci/docker/emscripten/build-emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/ci/docker/linux-tested-targets/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_trans/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
12 changes: 8 additions & 4 deletions src/test/run-pass/sse2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 72c3148

Please sign in to comment.