mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-05-19 09:40:22 -07:00
parent
d73a75d6cd
commit
d775259ed9
20
.travis.yml
20
.travis.yml
@ -25,6 +25,16 @@ matrix:
|
|||||||
- os: osx
|
- os: osx
|
||||||
rust: nightly
|
rust: nightly
|
||||||
env: TARGET=x86_64-apple-darwin
|
env: TARGET=x86_64-apple-darwin
|
||||||
|
- os: linux
|
||||||
|
rust: nightly
|
||||||
|
env: TARGET=arm-unknown-linux-gnueabihf GCC_VERSION=4.8
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- gcc-4.8-arm-linux-gnueabihf
|
||||||
|
- binutils-arm-linux-gnueabihf
|
||||||
|
- libc6-armhf-cross
|
||||||
|
- libc6-dev-armhf-cross
|
||||||
# Beta channel.
|
# Beta channel.
|
||||||
- os: linux
|
- os: linux
|
||||||
rust: beta
|
rust: beta
|
||||||
@ -39,6 +49,16 @@ matrix:
|
|||||||
- os: linux
|
- os: linux
|
||||||
rust: 1.17.0
|
rust: 1.17.0
|
||||||
env: TARGET=x86_64-unknown-linux-musl
|
env: TARGET=x86_64-unknown-linux-musl
|
||||||
|
- os: linux
|
||||||
|
rust: 1.17.0
|
||||||
|
env: TARGET=arm-unknown-linux-gnueabihf GCC_VERSION=4.8
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- gcc-4.8-arm-linux-gnueabihf
|
||||||
|
- binutils-arm-linux-gnueabihf
|
||||||
|
- libc6-armhf-cross
|
||||||
|
- libc6-dev-armhf-cross
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- export PATH="$PATH:$HOME/.cargo/bin"
|
- export PATH="$PATH:$HOME/.cargo/bin"
|
||||||
|
@ -6,8 +6,12 @@ set -ex
|
|||||||
|
|
||||||
# Generate artifacts for release
|
# Generate artifacts for release
|
||||||
mk_artifacts() {
|
mk_artifacts() {
|
||||||
RUSTFLAGS="-C target-feature=+ssse3" \
|
if is_ssse3_target; then
|
||||||
cargo build --target $TARGET --release --features simd-accel
|
RUSTFLAGS="-C target-feature=+ssse3" \
|
||||||
|
cargo build --target $TARGET --release --features simd-accel
|
||||||
|
else
|
||||||
|
cargo build --target $TARGET --release
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
mk_tarball() {
|
mk_tarball() {
|
||||||
@ -15,11 +19,12 @@ mk_tarball() {
|
|||||||
local td=$(mktempd)
|
local td=$(mktempd)
|
||||||
local out_dir=$(pwd)
|
local out_dir=$(pwd)
|
||||||
local name="${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}"
|
local name="${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}"
|
||||||
mkdir "$td/$name"
|
local gcc_prefix="$(gcc_prefix)"
|
||||||
|
mkdir "${td:?}/${name}"
|
||||||
mkdir "$td/$name/complete"
|
mkdir "$td/$name/complete"
|
||||||
|
|
||||||
cp target/$TARGET/release/rg "$td/$name/rg"
|
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 {doc/rg.1,README.md,UNLICENSE,COPYING,LICENSE-MIT} "$td/$name/"
|
||||||
cp \
|
cp \
|
||||||
target/$TARGET/release/build/ripgrep-*/out/{rg.bash-completion,rg.fish,_rg.ps1} \
|
target/$TARGET/release/build/ripgrep-*/out/{rg.bash-completion,rg.fish,_rg.ps1} \
|
||||||
|
@ -31,16 +31,19 @@ install_standard_crates() {
|
|||||||
|
|
||||||
configure_cargo() {
|
configure_cargo() {
|
||||||
local prefix=$(gcc_prefix)
|
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
|
# information about the cross compiler
|
||||||
${prefix}gcc -v
|
${gcc} -v
|
||||||
|
|
||||||
# tell cargo which linker to use for cross compilation
|
# tell cargo which linker to use for cross compilation
|
||||||
mkdir -p .cargo
|
mkdir -p .cargo
|
||||||
cat >>.cargo/config <<EOF
|
cat >>.cargo/config <<EOF
|
||||||
[target.$TARGET]
|
[target.$TARGET]
|
||||||
linker = "${prefix}gcc"
|
linker = "${gcc}"
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
34
ci/script.sh
34
ci/script.sh
@ -4,6 +4,9 @@ set -ex
|
|||||||
|
|
||||||
. $(dirname $0)/utils.sh
|
. $(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
|
# 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
|
# This has been fixed in the nightly channel but it would take a while to reach the other channels
|
||||||
disable_cross_doctests() {
|
disable_cross_doctests() {
|
||||||
@ -15,28 +18,23 @@ disable_cross_doctests() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_test_suite() {
|
run_cargo() {
|
||||||
cargo clean --target $TARGET --verbose
|
for component in "${components[@]}"; do
|
||||||
cargo build --target $TARGET --verbose
|
cargo "${1:?}" --target $TARGET --verbose --manifest-path "${component}/Cargo.toml"
|
||||||
cargo test --target $TARGET --verbose
|
done
|
||||||
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"
|
main() {
|
||||||
|
# disable_cross_doctests
|
||||||
|
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
|
# sanity check the file type
|
||||||
file target/$TARGET/debug/rg
|
file target/$TARGET/debug/rg
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
|
||||||
# disable_cross_doctests
|
|
||||||
run_test_suite
|
|
||||||
}
|
|
||||||
|
|
||||||
main
|
main
|
||||||
|
14
ci/utils.sh
14
ci/utils.sh
@ -39,11 +39,11 @@ dobin() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
architecture() {
|
architecture() {
|
||||||
case $1 in
|
case ${TARGET:?} in
|
||||||
x86_64-unknown-linux-gnu|x86_64-unknown-linux-musl)
|
x86_64-*)
|
||||||
echo amd64
|
echo amd64
|
||||||
;;
|
;;
|
||||||
i686-unknown-linux-gnu|i686-unknown-linux-musl)
|
i686-*|i586-*|i386-*)
|
||||||
echo i386
|
echo i386
|
||||||
;;
|
;;
|
||||||
arm*-unknown-linux-gnueabihf)
|
arm*-unknown-linux-gnueabihf)
|
||||||
@ -54,3 +54,11 @@ architecture() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_ssse3_target() {
|
||||||
|
case "${TARGET}" in
|
||||||
|
i686-unknown-netbsd) return 1 ;; # i686-unknown-netbsd - SSE2
|
||||||
|
i686*|x86_64*) return 0 ;;
|
||||||
|
esac
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user