diff options
author | Lilian A. Moraru <lilian.moraru90@gmail.com> | 2017-12-17 15:41:51 +0200 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2017-12-18 16:26:27 -0500 |
commit | d775259ed9399037e1a1da0ff65dd377bc8b82d1 (patch) | |
tree | 5bc68bd932e600772a28d0cfd4d441782d5d481a /ci | |
parent | d73a75d6cd82068252c35c5718900b6a1acb296e (diff) |
Add armhf build to Travis CI
Fixes #676
Diffstat (limited to 'ci')
-rw-r--r-- | ci/before_deploy.sh | 13 | ||||
-rw-r--r-- | ci/install.sh | 9 | ||||
-rw-r--r-- | ci/script.sh | 34 | ||||
-rw-r--r-- | ci/utils.sh | 14 |
4 files changed, 42 insertions, 28 deletions
diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh index ed5795c0..4890f96b 100644 --- a/ci/before_deploy.sh +++ b/ci/before_deploy.sh @@ -6,8 +6,12 @@ set -ex # Generate artifacts for release mk_artifacts() { - RUSTFLAGS="-C target-feature=+ssse3" \ - cargo build --target $TARGET --release --features simd-accel + if is_ssse3_target; then + RUSTFLAGS="-C target-feature=+ssse3" \ + cargo build --target $TARGET --release --features simd-accel + else + cargo build --target $TARGET --release + fi } mk_tarball() { @@ -15,11 +19,12 @@ mk_tarball() { local td=$(mktempd) local out_dir=$(pwd) local name="${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}" - mkdir "$td/$name" + local gcc_prefix="$(gcc_prefix)" + mkdir "${td:?}/${name}" mkdir "$td/$name/complete" cp target/$TARGET/release/rg "$td/$name/rg" - strip "$td/$name/rg" + ${gcc_prefix}strip "$td/$name/rg" cp {doc/rg.1,README.md,UNLICENSE,COPYING,LICENSE-MIT} "$td/$name/" cp \ target/$TARGET/release/build/ripgrep-*/out/{rg.bash-completion,rg.fish,_rg.ps1} \ diff --git a/ci/install.sh b/ci/install.sh index a4d8c7b4..ffddf866 100644 --- a/ci/install.sh +++ b/ci/install.sh @@ -31,16 +31,19 @@ install_standard_crates() { configure_cargo() { local prefix=$(gcc_prefix) + if [ -n "${prefix}" ]; then + local gcc_suffix= + test -n "${GCC_VERSION}" && gcc_suffix="-${GCC_VERSION}" || : + local gcc="${prefix}gcc${gcc_suffix}" - if [ ! -z $prefix ]; then # information about the cross compiler - ${prefix}gcc -v + ${gcc} -v # tell cargo which linker to use for cross compilation mkdir -p .cargo cat >>.cargo/config <<EOF [target.$TARGET] -linker = "${prefix}gcc" +linker = "${gcc}" EOF fi } diff --git a/ci/script.sh b/ci/script.sh index b41c9a8d..299f562f 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -4,6 +4,9 @@ set -ex . $(dirname $0)/utils.sh +# "." - dot is for the current directory(ripgrep itself) +components=( . grep globset ignore termcolor ) + # NOTE Workaround for rust-lang/rust#31907 - disable doc tests when cross compiling # This has been fixed in the nightly channel but it would take a while to reach the other channels disable_cross_doctests() { @@ -15,28 +18,23 @@ disable_cross_doctests() { fi } -run_test_suite() { - cargo clean --target $TARGET --verbose - cargo build --target $TARGET --verbose - cargo test --target $TARGET --verbose - cargo build --target $TARGET --verbose --manifest-path grep/Cargo.toml - cargo test --target $TARGET --verbose --manifest-path grep/Cargo.toml - cargo build --target $TARGET --verbose --manifest-path globset/Cargo.toml - cargo test --target $TARGET --verbose --manifest-path globset/Cargo.toml - cargo build --target $TARGET --verbose --manifest-path ignore/Cargo.toml - cargo test --target $TARGET --verbose --manifest-path ignore/Cargo.toml - cargo build --target $TARGET --verbose --manifest-path termcolor/Cargo.toml - cargo test --target $TARGET --verbose --manifest-path termcolor/Cargo.toml - - "$( dirname "${0}" )/test_complete.sh" - - # sanity check the file type - file target/$TARGET/debug/rg +run_cargo() { + for component in "${components[@]}"; do + cargo "${1:?}" --target $TARGET --verbose --manifest-path "${component}/Cargo.toml" + done } main() { # disable_cross_doctests - run_test_suite + run_cargo clean + run_cargo build + if [ "$(architecture)" = "amd64" ] || [ "$(architecture)" = "i386" ]; then + run_cargo test + "$( dirname "${0}" )/test_complete.sh" + fi + + # sanity check the file type + file target/$TARGET/debug/rg } main diff --git a/ci/utils.sh b/ci/utils.sh index 32c7de37..7dcd7cec 100644 --- a/ci/utils.sh +++ b/ci/utils.sh @@ -39,11 +39,11 @@ dobin() { } architecture() { - case $1 in - x86_64-unknown-linux-gnu|x86_64-unknown-linux-musl) + case ${TARGET:?} in + x86_64-*) echo amd64 ;; - i686-unknown-linux-gnu|i686-unknown-linux-musl) + i686-*|i586-*|i386-*) echo i386 ;; arm*-unknown-linux-gnueabihf) @@ -54,3 +54,11 @@ architecture() { ;; esac } + +is_ssse3_target() { + case "${TARGET}" in + i686-unknown-netbsd) return 1 ;; # i686-unknown-netbsd - SSE2 + i686*|x86_64*) return 0 ;; + esac + return 1 +} |