diff --git a/.travis.yml b/.travis.yml index a6b97206e6..3e46c18626 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,10 @@ jobs: include: # Linux - name: "aarch64-unknown-linux-gnu" - env: TARGET=aarch64-unknown-linux-gnu + env: TARGET=aarch64-unknown-linux-gnu NO_JEMALLOC_TESTS=1 arch: arm64 - name: "powerpc64le-unknown-linux-gnu" - env: TARGET=powerpc64le-unknown-linux-gnu + env: TARGET=powerpc64le-unknown-linux-gnu NO_JEMALLOC_TESTS=1 arch: ppc64le - name: "x86_64-unknown-linux-gnu (nightly)" env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1 @@ -32,6 +32,11 @@ jobs: # - cargo test --features=alloc_trait --bench roundtrip - name: "x86_64-unknown-linux-musl" env: TARGET=x86_64-unknown-linux-musl NOBGT=1 NO_JEMALLOC_TESTS=1 + install: rustup target add x86_64-unknown-linux-musl + addons: + apt: + packages: + musl-tools # OSX # FIXME: cannot jemalloc tests fail due to: diff --git a/ci/run.sh b/ci/run.sh index eacd191d24..5eda43df6e 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -40,10 +40,6 @@ then esac fi -if [ "${TARGET}" = "x86_64-unknown-linux-musl" ]; then - rustup toolchain install stable-x86_64-unknown-linux-musl -fi - if [ "${TARGET}" = "x86_64-unknown-linux-gnu" ] || [ "${TARGET}" = "x86_64-apple-darwin" ] then # Not using tee to avoid too much logs that exceeds travis' limit. diff --git a/jemalloc-sys/build.rs b/jemalloc-sys/build.rs index f8e04bed18..a25b34496d 100644 --- a/jemalloc-sys/build.rs +++ b/jemalloc-sys/build.rs @@ -262,7 +262,7 @@ fn main() { cmd.arg(format!("--build={}", gnu_target(&host))); cmd.arg(format!("--prefix={}", out_dir.display())); - run(&mut cmd); + run_and_log(&mut cmd, &build_dir.join("config.log")); // Make: let make = make_cmd(&host); @@ -315,13 +315,24 @@ fn main() { println!("cargo:rerun-if-changed=jemalloc"); } +fn run_and_log(cmd: &mut Command, log_file: &Path) { + execute(cmd, || { + run(Command::new("tail").arg("-n").arg("100").arg(log_file)); + }) +} + fn run(cmd: &mut Command) { + execute(cmd, || ()); +} + +fn execute(cmd: &mut Command, on_fail: impl FnOnce()) { println!("running: {:?}", cmd); let status = match cmd.status() { Ok(status) => status, Err(e) => panic!("failed to execute command: {}", e), }; if !status.success() { + on_fail(); panic!( "command did not execute successfully: {:?}\n\ expected success, got: {}",