Skip to content

Commit 21c54a2

Browse files
authored
*: update jemalloc and simplify build (#1)
- 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 <BusyJayLee@gmail.com>
1 parent a09f18a commit 21c54a2

File tree

8 files changed

+682
-461
lines changed

8 files changed

+682
-461
lines changed

.travis.yml

Lines changed: 9 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -7,61 +7,17 @@ jobs:
77
# Linux
88
- name: "aarch64-unknown-linux-gnu"
99
env: TARGET=aarch64-unknown-linux-gnu NO_JEMALLOC_TESTS=1
10-
- name: "arm-unknown-linux-gnueabi"
11-
env: TARGET=arm-unknown-linux-gnueabi NO_JEMALLOC_TESTS=1
12-
- name: "armv7-unknown-linux-gnueabihf"
13-
env: TARGET=armv7-unknown-linux-gnueabihf NO_JEMALLOC_TESTS=1
14-
- name: "i586-unknown-linux-gnu"
15-
env: TARGET=i586-unknown-linux-gnu
16-
addons: &gcc_multilib
17-
apt:
18-
packages:
19-
- gcc-multilib
20-
- name: "i686-unknown-linux-gnu (nightly)"
21-
env: TARGET=i686-unknown-linux-gnu
22-
addons: *gcc_multilib
23-
- name: "i686-unknown-linux-gnu (beta)"
24-
env: TARGET=i686-unknown-linux-gnu
25-
addons: *gcc_multilib
26-
rust: beta
27-
- name: "i686-unknown-linux-gnu (stable)"
28-
env: TARGET=i686-unknown-linux-gnu
29-
addons: *gcc_multilib
30-
rust: stable
31-
# FIXME: blocked onhttps://github.com/jemalloc/jemalloc/issues/1464
32-
# - name: "i686-unknown-linux-musl"
33-
# env: TARGET=i686-unknown-linux-musl NOBGT=1 NO_JEMALLOC_TESTS=1
34-
- name: "mips-unknown-linux-gnu"
35-
env: TARGET=mips-unknown-linux-gnu NO_JEMALLOC_TESTS=1
36-
- name: "mips64-unknown-linux-gnuabi64"
37-
env: TARGET=mips64-unknown-linux-gnuabi64 NO_JEMALLOC_TESTS=1
38-
- name: "mips64el-unknown-linux-gnuabi64"
39-
env: TARGET=mips64el-unknown-linux-gnuabi64 NO_JEMALLOC_TESTS=1
40-
- name: "mipsel-unknown-linux-gnu"
41-
env: TARGET=mipsel-unknown-linux-gnu NO_JEMALLOC_TESTS=1
42-
- name: "powerpc-unknown-linux-gnu"
43-
env: TARGET=powerpc-unknown-linux-gnu NO_JEMALLOC_TESTS=1
44-
- name: "powerpc64-unknown-linux-gnu"
45-
env: TARGET=powerpc64-unknown-linux-gnu NO_JEMALLOC_TESTS=1
10+
arch: arm64
4611
- name: "powerpc64le-unknown-linux-gnu"
4712
env: TARGET=powerpc64le-unknown-linux-gnu NO_JEMALLOC_TESTS=1
13+
arch: ppc64le
4814
- name: "x86_64-unknown-linux-gnu (nightly)"
49-
env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1 JEMALLOC_SYS_VERIFY_CONFIGURE=1
15+
env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1
5016
install: rustup component add llvm-tools-preview
5117
addons: &valgrind
5218
apt:
5319
packages:
5420
- valgrind
55-
- autoconf
56-
- name: "x86_64-unknown-linux-gnu (nightly - jemalloc's dev branch)"
57-
env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1 JEMALLOC_SYS_GIT_DEV_BRANCH=1
58-
install: rustup component add llvm-tools-preview
59-
addons: *valgrind
60-
- name: "x86_64-unknown-linux-gnu (beta)"
61-
env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1
62-
rust: beta
63-
install: rustup component add llvm-tools-preview
64-
addons: *valgrind
6521
- name: "x86_64-unknown-linux-gnu (stable)"
6622
env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1
6723
rust: stable
@@ -76,12 +32,11 @@ jobs:
7632
# - cargo test --features=alloc_trait --bench roundtrip
7733
- name: "x86_64-unknown-linux-musl"
7834
env: TARGET=x86_64-unknown-linux-musl NOBGT=1 NO_JEMALLOC_TESTS=1
79-
80-
# Android
81-
- name: "aarch64-linux-android"
82-
env: TARGET=aarch64-linux-android NO_JEMALLOC_TESTS=1
83-
- name: "x86_64-linux-android"
84-
env: TARGET=x86_64-linux-android
35+
install: rustup target add x86_64-unknown-linux-musl
36+
addons:
37+
apt:
38+
packages:
39+
musl-tools
8540

8641
# OSX
8742
# FIXME: cannot jemalloc tests fail due to:
@@ -90,20 +45,10 @@ jobs:
9045
# FIXME: valgrind fails on OSX
9146
# https://github.com/gnzlbg/jemallocator/issues/86
9247
- name: "x86_64-apple-darwin (nightly)"
93-
env: TARGET=x86_64-apple-darwin NO_JEMALLOC_TESTS=1 # JEMALLOC_SYS_VERIFY_CONFIGURE=1
94-
os: osx
95-
osx_image: xcode10
96-
install: rustup component add llvm-tools-preview
97-
- name: "x86_64-apple-darwin (nightly - jemalloc's dev branch)"
98-
env: TARGET=x86_64-apple-darwin NO_JEMALLOC_TESTS=1 JEMALLOC_SYS_GIT_DEV_BRANCH=1
99-
os: osx
100-
osx_image: xcode10
101-
install: rustup component add llvm-tools-preview
102-
- name: "x86_64-apple-darwin (beta)"
10348
env: TARGET=x86_64-apple-darwin NO_JEMALLOC_TESTS=1
10449
os: osx
10550
osx_image: xcode10
106-
rust: beta
51+
install: rustup component add llvm-tools-preview
10752
install: rustup component add llvm-tools-preview
10853
- name: "x86_64-apple-darwin (stable)"
10954
env: TARGET=x86_64-apple-darwin NO_JEMALLOC_TESTS=1

Cross.toml

Lines changed: 0 additions & 16 deletions
This file was deleted.

ci/run.sh

Lines changed: 21 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ echo "Running tests for target: ${TARGET}, Rust version=${TRAVIS_RUST_VERSION}"
88
export RUST_BACKTRACE=1
99
export RUST_TEST_THREADS=1
1010
export RUST_TEST_NOCAPTURE=1
11-
export CARGO_CMD=cross
1211

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

28-
# Use cargo on native CI platforms:
29-
case "${TARGET}" in
30-
"x86_64-unknown-linux-gnu") export CARGO_CMD=cargo ;;
31-
*"windows"*) export CARGO_CMD=cargo ;;
32-
*"apple"*) export CARGO_CMD=cargo ;;
33-
esac
34-
35-
if [ "${CARGO_CMD}" = "cross" ]
36-
then
37-
cargo install cross || echo "cross is already installed"
38-
fi
39-
4027
if [ "${VALGRIND}" = "1" ]
4128
then
4229
case "${TARGET}" in
@@ -56,7 +43,7 @@ fi
5643
if [ "${TARGET}" = "x86_64-unknown-linux-gnu" ] || [ "${TARGET}" = "x86_64-apple-darwin" ]
5744
then
5845
# Not using tee to avoid too much logs that exceeds travis' limit.
59-
if ! ${CARGO_CMD} build -vv --target "${TARGET}" > build_no_std.txt 2>&1; then
46+
if ! cargo build -vv --target "${TARGET}" > build_no_std.txt 2>&1; then
6047
tail -n 1024 build_no_std.txt
6148
exit 1
6249
fi
@@ -75,42 +62,28 @@ then
7562
done
7663
fi
7764

78-
${CARGO_CMD} test --target "${TARGET}"
65+
cargo test --target "${TARGET}"
66+
cargo test --target "${TARGET}" --features profiling
67+
cargo test --target "${TARGET}" --features debug
68+
cargo test --target "${TARGET}" --features stats
69+
cargo test --target "${TARGET}" --features 'debug profiling'
7970

80-
if [ "${JEMALLOC_SYS_GIT_DEV_BRANCH}" = "1" ]; then
81-
# FIXME: profiling tests broken on dev-branch
82-
# https://github.com/jemalloc/jemalloc/issues/1477
83-
:
84-
else
85-
${CARGO_CMD} test --target "${TARGET}" --features profiling
86-
fi
87-
88-
${CARGO_CMD} test --target "${TARGET}" --features debug
89-
${CARGO_CMD} test --target "${TARGET}" --features stats
90-
if [ "${JEMALLOC_SYS_GIT_DEV_BRANCH}" = "1" ]; then
91-
# FIXME: profiling tests broken on dev-branch
92-
# https://github.com/jemalloc/jemalloc/issues/1477
93-
:
94-
else
95-
${CARGO_CMD} test --target "${TARGET}" --features 'debug profiling'
96-
fi
97-
98-
${CARGO_CMD} test --target "${TARGET}" \
99-
--features unprefixed_malloc_on_supported_platforms
100-
${CARGO_CMD} test --target "${TARGET}" --no-default-features
101-
${CARGO_CMD} test --target "${TARGET}" --no-default-features \
102-
--features background_threads_runtime_support
71+
cargo test --target "${TARGET}" \
72+
--features unprefixed_malloc_on_supported_platforms
73+
cargo test --target "${TARGET}" --no-default-features
74+
cargo test --target "${TARGET}" --no-default-features \
75+
--features background_threads_runtime_support
10376

10477
if [ "${NOBGT}" = "1" ]
10578
then
10679
echo "enabling background threads by default at run-time is not tested"
10780
else
108-
${CARGO_CMD} test --target "${TARGET}" --features background_threads
81+
cargo test --target "${TARGET}" --features background_threads
10982
fi
11083

111-
${CARGO_CMD} test --target "${TARGET}" --release
112-
${CARGO_CMD} test --target "${TARGET}" --manifest-path jemalloc-sys/Cargo.toml
113-
${CARGO_CMD} test --target "${TARGET}" \
84+
cargo test --target "${TARGET}" --release
85+
cargo test --target "${TARGET}" --manifest-path jemalloc-sys/Cargo.toml
86+
cargo test --target "${TARGET}" \
11487
--manifest-path jemalloc-sys/Cargo.toml \
11588
--features unprefixed_malloc_on_supported_platforms
11689

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

123-
${CARGO_CMD} test --target "${TARGET}" \
124-
--manifest-path jemalloc-ctl/Cargo.toml \
125-
--no-default-features
96+
cargo test --target "${TARGET}" \
97+
--manifest-path jemalloc-ctl/Cargo.toml \
98+
--no-default-features
12699
# FIXME: cross fails to pass features to jemalloc-ctl
127100
# ${CARGO_CMD} test --target "${TARGET}" \
128101
# --manifest-path jemalloc-ctl \
129102
# --no-default-features --features use_std
130103
;;
131104
esac
132105

133-
${CARGO_CMD} test --target "${TARGET}" -p systest
134-
${CARGO_CMD} test --target "${TARGET}" \
135-
--manifest-path jemallocator-global/Cargo.toml
136-
${CARGO_CMD} test --target "${TARGET}" \
106+
cargo test --target "${TARGET}" -p systest
107+
cargo test --target "${TARGET}" --manifest-path jemallocator-global/Cargo.toml
108+
cargo test --target "${TARGET}" \
137109
--manifest-path jemallocator-global/Cargo.toml \
138110
--features force_global_jemalloc
139111

jemalloc-sys/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,6 @@ hyphens `-` are replaced with underscores `_`(see
144144
virtual address size on those platforms where it knows how, and picks a
145145
default otherwise. This option may be useful when cross-compiling.
146146

147-
* `JEMALLOC_SYS_GIT_DEV_BRANCH`: when this environment variable is defined, the
148-
latest commit from `jemalloc`'s dev branch is fetched from
149-
`https://github.com/jemalloc/jemalloc` and built.
150-
151147
[jemalloc_install]: https://github.com/jemalloc/jemalloc/blob/dev/INSTALL.md#advanced-configuration
152148

153149
## License

0 commit comments

Comments
 (0)