From 6b23cc48dbe7d1035acd912051c271392036a0bd Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 16 Jan 2017 14:15:12 -0800 Subject: travis: Expand the `cross` linux image This expands the `cross` travis matrix entry with a few more targets that our nightlies are building: * x86_64-rumprun-netbsd * arm-unknown-linux-musleabi * arm-unknown-linux-musleabihf * armv7-unknown-linux-musleabihf * mips-unknown-linux-musl * mipsel-unknown-linux-musl This commit doesn't compile custom toolchains like our current cross-image does, but instead compiles musl manually and then compiles libunwind manually (like x86_64) for use for the ARM targets and just uses openwrt toolchains for the mips targets. --- src/bootstrap/cc.rs | 8 ++++++-- src/bootstrap/flags.rs | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/cc.rs b/src/bootstrap/cc.rs index aa70e24d952..54c8194678e 100644 --- a/src/bootstrap/cc.rs +++ b/src/bootstrap/cc.rs @@ -121,10 +121,14 @@ fn set_compiler(cfg: &mut gcc::Config, } "mips-unknown-linux-musl" => { - cfg.compiler("mips-linux-musl-gcc"); + if cfg.get_compiler().path().to_str() == Some("gcc") { + cfg.compiler("mips-linux-musl-gcc"); + } } "mipsel-unknown-linux-musl" => { - cfg.compiler("mipsel-linux-musl-gcc"); + if cfg.get_compiler().path().to_str() == Some("gcc") { + cfg.compiler("mipsel-linux-musl-gcc"); + } } t if t.contains("musl") => { diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs index 1be823417d7..c5bbfd89b27 100644 --- a/src/bootstrap/flags.rs +++ b/src/bootstrap/flags.rs @@ -287,8 +287,8 @@ To learn more about a subcommand, run `./x.py -h` build: m.opt_str("build").unwrap_or_else(|| { env::var("BUILD").unwrap() }), - host: m.opt_strs("host"), - target: m.opt_strs("target"), + host: split(m.opt_strs("host")), + target: split(m.opt_strs("target")), config: cfg_file, src: m.opt_str("src").map(PathBuf::from), jobs: m.opt_str("jobs").map(|j| j.parse().unwrap()), @@ -309,3 +309,7 @@ impl Subcommand { } } } + +fn split(s: Vec) -> Vec { + s.iter().flat_map(|s| s.split(',')).map(|s| s.to_string()).collect() +} -- cgit 1.4.1-3-g733a5 From e8f9d2d43a190074d52a0df40725ebd2c0fb0a9e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 16 Jan 2017 23:10:00 -0800 Subject: travis: Get an emscripten builder online This commit adds a new entry to the Travis matrix which will execute emscripten test suites. Along the way it updates a few bits of the test suite to continue passing on emscripten, such as: * Ignoring i128/u128 tests as they're presumably just not working (didn't investigate as to why) * Disabling a few process tests (not working on emscripten) * Ignore some num tests in libstd (#39119) * Fix some warnings when compiling --- src/bootstrap/sanity.rs | 2 +- src/ci/docker/emscripten/Dockerfile | 41 ++++++++++++++++++++++ src/ci/docker/emscripten/build-emscripten.sh | 19 ++++++++++ src/libstd/net/test.rs | 2 +- src/libstd/num.rs | 1 + src/test/codegen/fastcall-inreg.rs | 1 + src/test/compile-fail/asm-bad-clobber.rs | 1 + src/test/compile-fail/asm-in-bad-modifier.rs | 1 + src/test/compile-fail/asm-misplaced-option.rs | 1 + src/test/compile-fail/asm-out-assign-imm.rs | 1 + src/test/compile-fail/asm-out-no-modifier.rs | 1 + src/test/compile-fail/asm-out-read-uninit.rs | 1 + src/test/compile-fail/asm-src-loc-codegen-units.rs | 1 + src/test/compile-fail/asm-src-loc.rs | 2 ++ .../compile-fail/cdylib-deps-must-be-static.rs | 1 + .../compile-fail/macro-expanded-include/test.rs | 2 ++ .../panic-runtime/abort-link-to-unwind-dylib.rs | 1 + src/test/compile-fail/two-allocators-3.rs | 1 + .../run-pass-valgrind/down-with-thread-dtors.rs | 1 + src/test/run-pass-valgrind/exit-flushes.rs | 1 + src/test/run-pass/i128-ffi.rs | 2 ++ src/test/run-pass/i128.rs | 3 ++ src/test/run-pass/stdio-is-blocking.rs | 2 ++ src/test/run-pass/try-wait.rs | 2 ++ src/test/run-pass/u128.rs | 3 ++ 25 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 src/ci/docker/emscripten/Dockerfile create mode 100755 src/ci/docker/emscripten/build-emscripten.sh (limited to 'src/bootstrap') diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index 66bdd5e00f4..8e79c2d27d1 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -45,7 +45,7 @@ pub fn check(build: &mut Build) { let target = path.join(cmd); let mut cmd_alt = cmd.to_os_string(); cmd_alt.push(".exe"); - if target.exists() || + if target.is_file() || target.with_extension("exe").exists() || target.join(cmd_alt).exists() { return Some(target); diff --git a/src/ci/docker/emscripten/Dockerfile b/src/ci/docker/emscripten/Dockerfile new file mode 100644 index 00000000000..84e12eb6c3e --- /dev/null +++ b/src/ci/docker/emscripten/Dockerfile @@ -0,0 +1,41 @@ +FROM ubuntu:16.04 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + g++ \ + make \ + file \ + curl \ + ca-certificates \ + python \ + git \ + cmake \ + sudo \ + gdb \ + xz-utils \ + lib32stdc++6 + +ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783 +RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \ + tar xJf - -C /usr/local/bin --strip-components=1 + +RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ + dpkg -i dumb-init_*.deb && \ + rm dumb-init_*.deb +ENTRYPOINT ["/usr/bin/dumb-init", "--"] + +WORKDIR /tmp +COPY build-emscripten.sh /tmp/ +RUN ./build-emscripten.sh +ENV PATH=$PATH:/tmp/emsdk_portable +ENV PATH=$PATH:/tmp/emsdk_portable/clang/tag-e1.37.1/build_tag-e1.37.1_32/bin +ENV PATH=$PATH:/tmp/emsdk_portable/node/4.1.1_32bit/bin +ENV PATH=$PATH:/tmp/emsdk_portable/emscripten/tag-1.37.1 +ENV EMSCRIPTEN=/tmp/emsdk_portable/emscripten/tag-1.37.1 + +ENV RUST_CONFIGURE_ARGS --target=asmjs-unknown-emscripten + +# Run `emcc` first as it's got a prompt and doesn't actually do anything, after +# that's done with do the real build. +ENV SCRIPT emcc && \ + python2.7 ../x.py test --target asmjs-unknown-emscripten + diff --git a/src/ci/docker/emscripten/build-emscripten.sh b/src/ci/docker/emscripten/build-emscripten.sh new file mode 100755 index 00000000000..2ce7a58ae66 --- /dev/null +++ b/src/ci/docker/emscripten/build-emscripten.sh @@ -0,0 +1,19 @@ +#!/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 + +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 diff --git a/src/libstd/net/test.rs b/src/libstd/net/test.rs index 3f2eacda7d6..aec3d901ece 100644 --- a/src/libstd/net/test.rs +++ b/src/libstd/net/test.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[allow(dead_code)] // not used on emscripten +#![allow(warnings)] // not used on emscripten use env; use net::{SocketAddr, SocketAddrV4, SocketAddrV6, Ipv4Addr, Ipv6Addr, ToSocketAddrs}; diff --git a/src/libstd/num.rs b/src/libstd/num.rs index d1c2fc3d3fc..5f83d077a13 100644 --- a/src/libstd/num.rs +++ b/src/libstd/num.rs @@ -172,6 +172,7 @@ mod tests { macro_rules! test_checked_next_power_of_two { ($test_name:ident, $T:ident) => ( + #[cfg_attr(target_os = "emscripten", ignore)] // FIXME(#39119) fn $test_name() { #![test] assert_eq!((0 as $T).checked_next_power_of_two(), Some(1)); diff --git a/src/test/codegen/fastcall-inreg.rs b/src/test/codegen/fastcall-inreg.rs index e1dda4d2be0..1cbde9b1a7c 100644 --- a/src/test/codegen/fastcall-inreg.rs +++ b/src/test/codegen/fastcall-inreg.rs @@ -53,6 +53,7 @@ // ignore-shave // ignore-wasm32 // ignore-wasm64 +// ignore-emscripten // compile-flags: -C no-prepopulate-passes diff --git a/src/test/compile-fail/asm-bad-clobber.rs b/src/test/compile-fail/asm-bad-clobber.rs index 85832ddefe2..cb931329051 100644 --- a/src/test/compile-fail/asm-bad-clobber.rs +++ b/src/test/compile-fail/asm-bad-clobber.rs @@ -12,6 +12,7 @@ // ignore-arm // ignore-aarch64 // ignore-s390x +// ignore-emscripten #![feature(asm, rustc_attrs)] diff --git a/src/test/compile-fail/asm-in-bad-modifier.rs b/src/test/compile-fail/asm-in-bad-modifier.rs index a4d076fc90d..7ba5beac213 100644 --- a/src/test/compile-fail/asm-in-bad-modifier.rs +++ b/src/test/compile-fail/asm-in-bad-modifier.rs @@ -9,6 +9,7 @@ // except according to those terms. // ignore-s390x +// ignore-emscripten #![feature(asm)] diff --git a/src/test/compile-fail/asm-misplaced-option.rs b/src/test/compile-fail/asm-misplaced-option.rs index fbfc20f8d04..bafbf625e35 100644 --- a/src/test/compile-fail/asm-misplaced-option.rs +++ b/src/test/compile-fail/asm-misplaced-option.rs @@ -12,6 +12,7 @@ // ignore-arm // ignore-aarch64 // ignore-s390x +// ignore-emscripten #![feature(asm, rustc_attrs)] diff --git a/src/test/compile-fail/asm-out-assign-imm.rs b/src/test/compile-fail/asm-out-assign-imm.rs index 1329959fe49..161c0b977ff 100644 --- a/src/test/compile-fail/asm-out-assign-imm.rs +++ b/src/test/compile-fail/asm-out-assign-imm.rs @@ -9,6 +9,7 @@ // except according to those terms. // ignore-s390x +// ignore-emscripten #![feature(asm)] diff --git a/src/test/compile-fail/asm-out-no-modifier.rs b/src/test/compile-fail/asm-out-no-modifier.rs index d610f9e3440..cb8fb19a7c7 100644 --- a/src/test/compile-fail/asm-out-no-modifier.rs +++ b/src/test/compile-fail/asm-out-no-modifier.rs @@ -9,6 +9,7 @@ // except according to those terms. // ignore-s390x +// ignore-emscripten #![feature(asm)] diff --git a/src/test/compile-fail/asm-out-read-uninit.rs b/src/test/compile-fail/asm-out-read-uninit.rs index 360f89dda9c..42bff4c633a 100644 --- a/src/test/compile-fail/asm-out-read-uninit.rs +++ b/src/test/compile-fail/asm-out-read-uninit.rs @@ -9,6 +9,7 @@ // except according to those terms. // ignore-s390x +// ignore-emscripten #![feature(asm)] diff --git a/src/test/compile-fail/asm-src-loc-codegen-units.rs b/src/test/compile-fail/asm-src-loc-codegen-units.rs index 79f0c436759..df1a6d52f57 100644 --- a/src/test/compile-fail/asm-src-loc-codegen-units.rs +++ b/src/test/compile-fail/asm-src-loc-codegen-units.rs @@ -12,6 +12,7 @@ // ignore-stage1 // compile-flags: -C codegen-units=2 // error-pattern: build without -C codegen-units for more exact errors +// ignore-emscripten #![feature(asm)] diff --git a/src/test/compile-fail/asm-src-loc.rs b/src/test/compile-fail/asm-src-loc.rs index e3cece7c8f0..59b47c2408d 100644 --- a/src/test/compile-fail/asm-src-loc.rs +++ b/src/test/compile-fail/asm-src-loc.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-emscripten + #![feature(asm)] fn main() { diff --git a/src/test/compile-fail/cdylib-deps-must-be-static.rs b/src/test/compile-fail/cdylib-deps-must-be-static.rs index 4b160f26e92..853507cbc6d 100644 --- a/src/test/compile-fail/cdylib-deps-must-be-static.rs +++ b/src/test/compile-fail/cdylib-deps-must-be-static.rs @@ -11,6 +11,7 @@ // error-pattern: dependency `cdylib_dep` not found in rlib format // aux-build:cdylib-dep.rs // ignore-musl +// ignore-emscripten #![crate_type = "cdylib"] diff --git a/src/test/compile-fail/macro-expanded-include/test.rs b/src/test/compile-fail/macro-expanded-include/test.rs index e1e85ddb2c1..bcc2c10653f 100644 --- a/src/test/compile-fail/macro-expanded-include/test.rs +++ b/src/test/compile-fail/macro-expanded-include/test.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-emscripten + #![feature(asm, rustc_attrs)] #![allow(unused)] diff --git a/src/test/compile-fail/panic-runtime/abort-link-to-unwind-dylib.rs b/src/test/compile-fail/panic-runtime/abort-link-to-unwind-dylib.rs index c3242a5082b..1fd60b15a72 100644 --- a/src/test/compile-fail/panic-runtime/abort-link-to-unwind-dylib.rs +++ b/src/test/compile-fail/panic-runtime/abort-link-to-unwind-dylib.rs @@ -10,6 +10,7 @@ // compile-flags:-C panic=abort -C prefer-dynamic // ignore-musl - no dylibs here +// ignore-emscripten // error-pattern:`panic_unwind` is not compiled with this crate's panic strategy // This is a test where the local crate, compiled with `panic=abort`, links to diff --git a/src/test/compile-fail/two-allocators-3.rs b/src/test/compile-fail/two-allocators-3.rs index 7782d0e338e..965e4e0e2ea 100644 --- a/src/test/compile-fail/two-allocators-3.rs +++ b/src/test/compile-fail/two-allocators-3.rs @@ -11,6 +11,7 @@ // aux-build:allocator1.rs // error-pattern: cannot link together two allocators // ignore-musl no dylibs on musl yet +// ignore-emscripten // We're linking std dynamically (via -C prefer-dynamic for this test) which // has an allocator and then we're also linking in a new allocator (allocator1) diff --git a/src/test/run-pass-valgrind/down-with-thread-dtors.rs b/src/test/run-pass-valgrind/down-with-thread-dtors.rs index 0bf10c67d9f..90c20444842 100644 --- a/src/test/run-pass-valgrind/down-with-thread-dtors.rs +++ b/src/test/run-pass-valgrind/down-with-thread-dtors.rs @@ -9,6 +9,7 @@ // except according to those terms. // no-prefer-dynamic +// ignore-emscripten thread_local!(static FOO: Foo = Foo); thread_local!(static BAR: Bar = Bar(1)); diff --git a/src/test/run-pass-valgrind/exit-flushes.rs b/src/test/run-pass-valgrind/exit-flushes.rs index 1897b921401..b72d2659967 100644 --- a/src/test/run-pass-valgrind/exit-flushes.rs +++ b/src/test/run-pass-valgrind/exit-flushes.rs @@ -11,6 +11,7 @@ // no-prefer-dynamic // ignore-macos this needs valgrind 3.11 or higher; see // https://github.com/rust-lang/rust/pull/30365#issuecomment-165763679 +// ignore-emscripten use std::env; use std::process::{exit, Command}; diff --git a/src/test/run-pass/i128-ffi.rs b/src/test/run-pass/i128-ffi.rs index 3b5f4884d21..222f32754fb 100644 --- a/src/test/run-pass/i128-ffi.rs +++ b/src/test/run-pass/i128-ffi.rs @@ -20,6 +20,8 @@ // Ignore 32 bit targets: // ignore-x86, ignore-arm +// ignore-emscripten + #![feature(i128_type)] #[link(name = "rust_test_helpers", kind = "static")] diff --git a/src/test/run-pass/i128.rs b/src/test/run-pass/i128.rs index a4ff36d20e4..3eb1c950502 100644 --- a/src/test/run-pass/i128.rs +++ b/src/test/run-pass/i128.rs @@ -10,6 +10,9 @@ // ignore-stage0 // ignore-stage1 + +// ignore-emscripten + #![feature(i128_type, test)] extern crate test; diff --git a/src/test/run-pass/stdio-is-blocking.rs b/src/test/run-pass/stdio-is-blocking.rs index 74170ca6506..448bb7de772 100644 --- a/src/test/run-pass/stdio-is-blocking.rs +++ b/src/test/run-pass/stdio-is-blocking.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-emscripten + use std::env; use std::io::prelude::*; use std::process::Command; diff --git a/src/test/run-pass/try-wait.rs b/src/test/run-pass/try-wait.rs index fdaf0cfd5b0..d9826373cce 100644 --- a/src/test/run-pass/try-wait.rs +++ b/src/test/run-pass/try-wait.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-emscripten + #![feature(process_try_wait)] use std::env; diff --git a/src/test/run-pass/u128.rs b/src/test/run-pass/u128.rs index 53d726f1f66..139d42e3a35 100644 --- a/src/test/run-pass/u128.rs +++ b/src/test/run-pass/u128.rs @@ -10,6 +10,9 @@ // ignore-stage0 // ignore-stage1 + +// ignore-emscripten + #![feature(i128_type, test)] extern crate test; -- cgit 1.4.1-3-g733a5 From 72c3148bb34fe7365d33f78bd732385ab091f3cb Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 19 Jan 2017 17:18:12 -0800 Subject: More test fixes from rollup --- .travis.yml | 2 + appveyor.yml | 3 ++ src/bootstrap/compile.rs | 6 ++- src/ci/docker/cross/build-arm-musl.sh | 38 ++++++++++++------ src/ci/docker/cross/build-rumprun.sh | 1 - src/ci/docker/dist-arm-linux/Dockerfile | 18 +-------- src/ci/docker/dist-arm-linux/build-toolchains.sh | 45 ++++++++++++++++++++++ src/ci/docker/dist-armv7-aarch64-linux/Dockerfile | 17 +------- .../dist-armv7-aarch64-linux/build-toolchains.sh | 45 ++++++++++++++++++++++ src/ci/docker/emscripten/build-emscripten.sh | 23 +++++++++-- src/ci/docker/linux-tested-targets/Dockerfile | 2 +- src/librustc_trans/back/write.rs | 3 +- src/test/run-pass/sse2.rs | 12 ++++-- 13 files changed, 162 insertions(+), 53 deletions(-) create mode 100755 src/ci/docker/dist-arm-linux/build-toolchains.sh create mode 100755 src/ci/docker/dist-armv7-aarch64-linux/build-toolchains.sh (limited to 'src/bootstrap') 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"), -- cgit 1.4.1-3-g733a5