Skip to content

Commit

Permalink
*: update jemalloc and simplify build (#1)
Browse files Browse the repository at this point in the history
- Remove all cross compilation and reduce supporting platforms
- Remove complicated checks and builds
- Update jemalloc to 5.2.1
- Fix gnzlbg#147

Signed-off-by: Jay Lee <[email protected]>
  • Loading branch information
BusyJay authored Jul 21, 2020
1 parent a09f18a commit 21c54a2
Show file tree
Hide file tree
Showing 8 changed files with 682 additions and 461 deletions.
73 changes: 9 additions & 64 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,17 @@ jobs:
# Linux
- name: "aarch64-unknown-linux-gnu"
env: TARGET=aarch64-unknown-linux-gnu NO_JEMALLOC_TESTS=1
- name: "arm-unknown-linux-gnueabi"
env: TARGET=arm-unknown-linux-gnueabi NO_JEMALLOC_TESTS=1
- name: "armv7-unknown-linux-gnueabihf"
env: TARGET=armv7-unknown-linux-gnueabihf NO_JEMALLOC_TESTS=1
- name: "i586-unknown-linux-gnu"
env: TARGET=i586-unknown-linux-gnu
addons: &gcc_multilib
apt:
packages:
- gcc-multilib
- name: "i686-unknown-linux-gnu (nightly)"
env: TARGET=i686-unknown-linux-gnu
addons: *gcc_multilib
- name: "i686-unknown-linux-gnu (beta)"
env: TARGET=i686-unknown-linux-gnu
addons: *gcc_multilib
rust: beta
- name: "i686-unknown-linux-gnu (stable)"
env: TARGET=i686-unknown-linux-gnu
addons: *gcc_multilib
rust: stable
# FIXME: blocked onhttps://github.com/jemalloc/jemalloc/issues/1464
# - name: "i686-unknown-linux-musl"
# env: TARGET=i686-unknown-linux-musl NOBGT=1 NO_JEMALLOC_TESTS=1
- name: "mips-unknown-linux-gnu"
env: TARGET=mips-unknown-linux-gnu NO_JEMALLOC_TESTS=1
- name: "mips64-unknown-linux-gnuabi64"
env: TARGET=mips64-unknown-linux-gnuabi64 NO_JEMALLOC_TESTS=1
- name: "mips64el-unknown-linux-gnuabi64"
env: TARGET=mips64el-unknown-linux-gnuabi64 NO_JEMALLOC_TESTS=1
- name: "mipsel-unknown-linux-gnu"
env: TARGET=mipsel-unknown-linux-gnu NO_JEMALLOC_TESTS=1
- name: "powerpc-unknown-linux-gnu"
env: TARGET=powerpc-unknown-linux-gnu NO_JEMALLOC_TESTS=1
- name: "powerpc64-unknown-linux-gnu"
env: TARGET=powerpc64-unknown-linux-gnu NO_JEMALLOC_TESTS=1
arch: arm64
- name: "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 JEMALLOC_SYS_VERIFY_CONFIGURE=1
env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1
install: rustup component add llvm-tools-preview
addons: &valgrind
apt:
packages:
- valgrind
- autoconf
- name: "x86_64-unknown-linux-gnu (nightly - jemalloc's dev branch)"
env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1 JEMALLOC_SYS_GIT_DEV_BRANCH=1
install: rustup component add llvm-tools-preview
addons: *valgrind
- name: "x86_64-unknown-linux-gnu (beta)"
env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1
rust: beta
install: rustup component add llvm-tools-preview
addons: *valgrind
- name: "x86_64-unknown-linux-gnu (stable)"
env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1
rust: stable
Expand All @@ -76,12 +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

# Android
- name: "aarch64-linux-android"
env: TARGET=aarch64-linux-android NO_JEMALLOC_TESTS=1
- name: "x86_64-linux-android"
env: TARGET=x86_64-linux-android
install: rustup target add x86_64-unknown-linux-musl
addons:
apt:
packages:
musl-tools

# OSX
# FIXME: cannot jemalloc tests fail due to:
Expand All @@ -90,20 +45,10 @@ jobs:
# FIXME: valgrind fails on OSX
# https://github.com/gnzlbg/jemallocator/issues/86
- name: "x86_64-apple-darwin (nightly)"
env: TARGET=x86_64-apple-darwin NO_JEMALLOC_TESTS=1 # JEMALLOC_SYS_VERIFY_CONFIGURE=1
os: osx
osx_image: xcode10
install: rustup component add llvm-tools-preview
- name: "x86_64-apple-darwin (nightly - jemalloc's dev branch)"
env: TARGET=x86_64-apple-darwin NO_JEMALLOC_TESTS=1 JEMALLOC_SYS_GIT_DEV_BRANCH=1
os: osx
osx_image: xcode10
install: rustup component add llvm-tools-preview
- name: "x86_64-apple-darwin (beta)"
env: TARGET=x86_64-apple-darwin NO_JEMALLOC_TESTS=1
os: osx
osx_image: xcode10
rust: beta
install: rustup component add llvm-tools-preview
install: rustup component add llvm-tools-preview
- name: "x86_64-apple-darwin (stable)"
env: TARGET=x86_64-apple-darwin NO_JEMALLOC_TESTS=1
Expand Down
16 changes: 0 additions & 16 deletions Cross.toml

This file was deleted.

70 changes: 21 additions & 49 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ echo "Running tests for target: ${TARGET}, Rust version=${TRAVIS_RUST_VERSION}"
export RUST_BACKTRACE=1
export RUST_TEST_THREADS=1
export RUST_TEST_NOCAPTURE=1
export CARGO_CMD=cross

# FIXME: workaround cargo breaking Travis-CI again:
# https://github.com/rust-lang/cargo/issues/5721
Expand All @@ -25,18 +24,6 @@ else
export JEMALLOC_SYS_RUN_JEMALLOC_TESTS=1
fi

# Use cargo on native CI platforms:
case "${TARGET}" in
"x86_64-unknown-linux-gnu") export CARGO_CMD=cargo ;;
*"windows"*) export CARGO_CMD=cargo ;;
*"apple"*) export CARGO_CMD=cargo ;;
esac

if [ "${CARGO_CMD}" = "cross" ]
then
cargo install cross || echo "cross is already installed"
fi

if [ "${VALGRIND}" = "1" ]
then
case "${TARGET}" in
Expand All @@ -56,7 +43,7 @@ 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.
if ! ${CARGO_CMD} build -vv --target "${TARGET}" > build_no_std.txt 2>&1; then
if ! cargo build -vv --target "${TARGET}" > build_no_std.txt 2>&1; then
tail -n 1024 build_no_std.txt
exit 1
fi
Expand All @@ -75,42 +62,28 @@ then
done
fi

${CARGO_CMD} test --target "${TARGET}"
cargo test --target "${TARGET}"
cargo test --target "${TARGET}" --features profiling
cargo test --target "${TARGET}" --features debug
cargo test --target "${TARGET}" --features stats
cargo test --target "${TARGET}" --features 'debug profiling'

if [ "${JEMALLOC_SYS_GIT_DEV_BRANCH}" = "1" ]; then
# FIXME: profiling tests broken on dev-branch
# https://github.com/jemalloc/jemalloc/issues/1477
:
else
${CARGO_CMD} test --target "${TARGET}" --features profiling
fi

${CARGO_CMD} test --target "${TARGET}" --features debug
${CARGO_CMD} test --target "${TARGET}" --features stats
if [ "${JEMALLOC_SYS_GIT_DEV_BRANCH}" = "1" ]; then
# FIXME: profiling tests broken on dev-branch
# https://github.com/jemalloc/jemalloc/issues/1477
:
else
${CARGO_CMD} test --target "${TARGET}" --features 'debug profiling'
fi

${CARGO_CMD} test --target "${TARGET}" \
--features unprefixed_malloc_on_supported_platforms
${CARGO_CMD} test --target "${TARGET}" --no-default-features
${CARGO_CMD} test --target "${TARGET}" --no-default-features \
--features background_threads_runtime_support
cargo test --target "${TARGET}" \
--features unprefixed_malloc_on_supported_platforms
cargo test --target "${TARGET}" --no-default-features
cargo test --target "${TARGET}" --no-default-features \
--features background_threads_runtime_support

if [ "${NOBGT}" = "1" ]
then
echo "enabling background threads by default at run-time is not tested"
else
${CARGO_CMD} test --target "${TARGET}" --features background_threads
cargo test --target "${TARGET}" --features background_threads
fi

${CARGO_CMD} test --target "${TARGET}" --release
${CARGO_CMD} test --target "${TARGET}" --manifest-path jemalloc-sys/Cargo.toml
${CARGO_CMD} test --target "${TARGET}" \
cargo test --target "${TARGET}" --release
cargo test --target "${TARGET}" --manifest-path jemalloc-sys/Cargo.toml
cargo test --target "${TARGET}" \
--manifest-path jemalloc-sys/Cargo.toml \
--features unprefixed_malloc_on_supported_platforms

Expand All @@ -120,20 +93,19 @@ case "${TARGET}" in
"x86_64-unknown-linux-musl") ;;
*)

${CARGO_CMD} test --target "${TARGET}" \
--manifest-path jemalloc-ctl/Cargo.toml \
--no-default-features
cargo test --target "${TARGET}" \
--manifest-path jemalloc-ctl/Cargo.toml \
--no-default-features
# FIXME: cross fails to pass features to jemalloc-ctl
# ${CARGO_CMD} test --target "${TARGET}" \
# --manifest-path jemalloc-ctl \
# --no-default-features --features use_std
;;
esac

${CARGO_CMD} test --target "${TARGET}" -p systest
${CARGO_CMD} test --target "${TARGET}" \
--manifest-path jemallocator-global/Cargo.toml
${CARGO_CMD} test --target "${TARGET}" \
cargo test --target "${TARGET}" -p systest
cargo test --target "${TARGET}" --manifest-path jemallocator-global/Cargo.toml
cargo test --target "${TARGET}" \
--manifest-path jemallocator-global/Cargo.toml \
--features force_global_jemalloc

Expand Down
4 changes: 0 additions & 4 deletions jemalloc-sys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@ hyphens `-` are replaced with underscores `_`(see
virtual address size on those platforms where it knows how, and picks a
default otherwise. This option may be useful when cross-compiling.

* `JEMALLOC_SYS_GIT_DEV_BRANCH`: when this environment variable is defined, the
latest commit from `jemalloc`'s dev branch is fetched from
`https://github.com/jemalloc/jemalloc` and built.

[jemalloc_install]: https://github.com/jemalloc/jemalloc/blob/dev/INSTALL.md#advanced-configuration

## License
Expand Down
Loading

0 comments on commit 21c54a2

Please sign in to comment.