Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
  • Loading branch information
BusyJay committed Jul 20, 2020
1 parent b987121 commit 7b268d1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Expand Up @@ -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
Expand All @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions ci/run.sh
Expand Up @@ -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.
Expand Down
13 changes: 12 additions & 1 deletion jemalloc-sys/build.rs
Expand Up @@ -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);
Expand Down Expand Up @@ -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: {}",
Expand Down

0 comments on commit 7b268d1

Please sign in to comment.