Skip to content

Commit

Permalink
work around rust-lang/cargo#4699 and don't re-install rustup
Browse files Browse the repository at this point in the history
  • Loading branch information
japaric committed Nov 4, 2017
1 parent 9b534fd commit 74064d7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 25 deletions.
24 changes: 3 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@ language: rust
services: docker
sudo: required

rust: stable

env:
global:
- CRATE_NAME=xargo
- TARGET=x86_64-unknown-linux-gnu

matrix:
include:
# Linux
- env: TARGET=i686-unknown-linux-gnu
- env: TARGET=i686-unknown-linux-musl
# - env: TARGET=x86_64-unknown-linux-gnu # this is the default job
- env: TARGET=x86_64-unknown-linux-gnu
- env: TARGET=x86_64-unknown-linux-musl

# OSX
Expand All @@ -34,25 +27,14 @@ matrix:
rust: nightly
- env: TARGET=i686-apple-darwin
os: osx
rust: nightly
# old nightly to work around rust-lang/cargo#4699
rust: nightly-2017-10-04
- env: TARGET=x86_64-apple-darwin
os: osx
rust: nightly

install:
- sh ci/install.sh
# NOTE(sed) work around for #36501
- source ~/.cargo/env &&
rustup component add rust-src ||
true
- case $TRAVIS_OS_NAME in
linux)
find $(rustc --print sysroot) -name Cargo.toml -print0 | xargs -0 sed -i '/"dylib"/d';
;;
osx)
find $(rustc --print sysroot) -name Cargo.toml -print0 | xargs -0 sed -i '' '/"dylib"/d';
;;
esac

script:
- sh ci/script.sh
Expand Down
19 changes: 15 additions & 4 deletions ci/install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
set -ex
set -euxo pipefail

main() {
curl https://sh.rustup.rs -sSf | \
sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION

local target=
if [ $TRAVIS_OS_NAME = linux ]; then
target=x86_64-unknown-linux-gnu
Expand All @@ -13,6 +10,7 @@ main() {
sort=gsort # for `sort --sort-version`, from brew's coreutils.
fi

# install latest `cross` binary
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
| cut -d/ -f3 \
| grep -E '^v[0.1.0-9.]+$' \
Expand All @@ -24,6 +22,19 @@ main() {
--git japaric/cross \
--tag $tag \
--target $target

# needed to test Xargo
rustup component add rust-src

# NOTE(sed) work around for rust-lang/rust#36501
case $TRAVIS_OS_NAME in
linux)
find $(rustc --print sysroot) -name Cargo.toml -print0 | xargs -0 sed -i '/"dylib"/d';
;;
osx)
find $(rustc --print sysroot) -name Cargo.toml -print0 | xargs -0 sed -i '' '/"dylib"/d';
;;
esac
}

if [ ! -z $TRAVIS_TAG ] || [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_EVENT_TYPE = cron ]; then
Expand Down

0 comments on commit 74064d7

Please sign in to comment.