Skip to content

Commit fe9d82b

Browse files
committed
ci: try to improve build times
1 parent 9c79065 commit fe9d82b

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

bench/run

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ if [ $# = 0 ] || [ $1 = '-h' ] || [ $1 = '--help' ]; then
99
usage
1010
fi
1111

12-
# Enable SIMD.
13-
# export RUSTFLAGS="-C target-feature=+ssse3"
14-
export RUSTFLAGS="-C target-cpu=native"
12+
# Enable SIMD, unless we're in CI, then we inherit RUSTLFAGS.
13+
if [ -z "$TRAVIS_RUST_VERSION" ]; then
14+
export RUSTFLAGS="-C target-cpu=native"
15+
fi
1516

1617
which="$1"
1718
shift
@@ -29,7 +30,7 @@ case $which in
2930
exec cargo bench --bench bench --features re-rust-bytes "$@"
3031
;;
3132
re2)
32-
exec cargo bench --verbose --bench bench --features re-re2 "$@"
33+
exec cargo bench --bench bench --features re-re2 "$@"
3334
;;
3435
pcre1)
3536
exec cargo bench --bench bench --features re-pcre1 "$@"

ci/after_success.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if [ "$TRAVIS_RUST_VERSION" != "nightly" ] || [ "$TRAVIS_PULL_REQUEST" != "false
99
exit 0
1010
fi
1111

12+
export RUSTFLAGS="-C target-feature=+ssse3"
1213
env
1314

1415
# Build and upload docs.

ci/script.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
# This is the main CI script for testing the regex crate and its sub-crates.
44

5-
set -e
5+
set -ex
6+
7+
if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
8+
# We set this once so that all invocations share this setting. This should
9+
# help with build times by avoiding excessive re-compiles.
10+
export RUSTFLAGS="-C target-feature=+ssse3"
11+
fi
612

713
# Builds the regex crate and runs tests.
814
cargo build --verbose
@@ -17,11 +23,11 @@ if [ "$TRAVIS_RUST_VERSION" = "1.12.0" ]; then
1723
exit
1824
fi
1925

26+
# Run tests. If we have nightly, then enable our nightly features.
2027
if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
21-
cargo build --verbose --manifest-path regex-debug/Cargo.toml
22-
RUSTFLAGS="-C target-feature=+ssse3" cargo test --verbose --features 'simd-accel pattern' --jobs 4
28+
cargo test --verbose --features 'simd-accel pattern'
2329
else
24-
cargo test --verbose --jobs 4
30+
cargo test --verbose
2531
fi
2632

2733
# Run a test that confirms the shootout benchmarks are correct.
@@ -37,9 +43,10 @@ cargo build --verbose --manifest-path regex-capi/Cargo.toml
3743
(cd regex-capi/examples && ./compile && LD_LIBRARY_PATH=../../target/debug ./iter)
3844

3945
# Make sure benchmarks compile. Don't run them though because they take a
40-
# very long time.
46+
# very long time. Also, check that we can build the regex-debug tool.
4147
if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
48+
cargo build --verbose --manifest-path regex-debug/Cargo.toml
4249
for x in rust rust-bytes pcre1 onig; do
43-
(cd bench && ./run $x --no-run)
50+
(cd bench && ./run $x --no-run --verbose)
4451
done
4552
fi

0 commit comments

Comments
 (0)