From 4d84b1630b586e4de9436e37f357b480132540fd Mon Sep 17 00:00:00 2001 From: Christopher Durham Date: Sat, 2 Dec 2017 21:26:09 -0500 Subject: [PATCH 1/4] Fix macOS build - Ensure python is available https://github.com/travis-ci/travis-ci/issues/2312 - Only pip install --user on linux, macOS is in virtualenv - Set PATH in a os-agnostic manner https://github.com/huonw/travis-cargo/pull/71 --- .travis.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d6bf62e34d2..5ece4e0dbe6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,15 @@ addons: before_script: - | - pip install 'travis-cargo<0.2' --user && - export PATH=$HOME/.local/bin:/usr/local/bin:$PATH + if [ $TRAVIS_OS_NAME = 'osx' ]; then + brew install python3 + virtualenv env -p python3 + source env/bin/activate + pip install 'travis-cargo<0.2' + else + pip install 'travis-cargo<0.2' --user + fi +- export PATH="$(python -m site --user-base)/bin:$PATH" script: - | From 0145ba7082705c07c331c07834050bfdf02345fe Mon Sep 17 00:00:00 2001 From: Christopher Durham Date: Tue, 5 Dec 2017 21:42:00 -0500 Subject: [PATCH 2/4] Only export path for linux as per [@davidalber's advice](https://github.com/rust-lang-nursery/rustfmt/pull/2229#discussion_r155129274) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5ece4e0dbe6..c985eccf283 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,8 @@ before_script: pip install 'travis-cargo<0.2' else pip install 'travis-cargo<0.2' --user + export PATH="$(python -m site --user-base)/bin:$PATH" fi -- export PATH="$(python -m site --user-base)/bin:$PATH" script: - | From 0a6ce8f187a6b47ee960299f4772abc47e840032 Mon Sep 17 00:00:00 2001 From: Christopher Durham Date: Wed, 6 Dec 2017 04:12:34 -0500 Subject: [PATCH 3/4] Chain commands by && See https://github.com/rust-lang-nursery/rustfmt/pull/2229/files#r155177741 for reasoning --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index c985eccf283..f5af19d0c45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,12 +21,12 @@ addons: before_script: - | if [ $TRAVIS_OS_NAME = 'osx' ]; then - brew install python3 - virtualenv env -p python3 - source env/bin/activate - pip install 'travis-cargo<0.2' + brew install python3 && + virtualenv env -p python3 && + source env/bin/activate && + pip install 'travis-cargo<0.2' && else - pip install 'travis-cargo<0.2' --user + pip install 'travis-cargo<0.2' --user && export PATH="$(python -m site --user-base)/bin:$PATH" fi From ba4832a14a052c9e5572f33a14e638887534e783 Mon Sep 17 00:00:00 2001 From: Christopher Durham Date: Wed, 6 Dec 2017 17:47:48 -0500 Subject: [PATCH 4/4] Remove excess trailing && --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f5af19d0c45..8da1043e031 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_script: brew install python3 && virtualenv env -p python3 && source env/bin/activate && - pip install 'travis-cargo<0.2' && + pip install 'travis-cargo<0.2' else pip install 'travis-cargo<0.2' --user && export PATH="$(python -m site --user-base)/bin:$PATH"