2019-04-23 11:18:42 +00:00
|
|
|
#!/bin/bash
|
2018-05-04 16:20:28 +00:00
|
|
|
|
2019-03-11 11:19:46 +00:00
|
|
|
set -e
|
2018-05-04 16:20:28 +00:00
|
|
|
|
|
|
|
### Setup Rust toolchain #######################################################
|
|
|
|
|
2018-08-04 17:14:41 +00:00
|
|
|
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=$TRAVIS_RUST_VERSION
|
2018-05-04 16:20:28 +00:00
|
|
|
export PATH=$PATH:$HOME/.cargo/bin
|
2019-03-24 16:19:15 +00:00
|
|
|
if [ "$TRAVIS_JOB_NAME" = "Minimum nightly" ]; then
|
2019-02-18 15:00:42 +00:00
|
|
|
rustup component add clippy
|
|
|
|
rustup component add rustfmt
|
|
|
|
fi
|
2018-05-04 16:20:28 +00:00
|
|
|
|
2019-04-23 11:18:42 +00:00
|
|
|
### Setup PyPy ################################################################
|
|
|
|
|
|
|
|
if [[ $FEATURES == *"pypy"* ]]; then
|
|
|
|
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
|
|
|
|
/bin/bash Miniconda3-latest-Linux-x86_64.sh -f -b -p /opt/anaconda && \
|
|
|
|
/opt/anaconda/bin/conda install --quiet --yes conda && \
|
|
|
|
/opt/anaconda/bin/conda config --system --add channels conda-forge && \
|
|
|
|
/opt/anaconda/bin/conda init bash && \
|
|
|
|
/opt/anaconda/bin/conda create -n pypy3 pypy3.5 -y && \
|
|
|
|
/opt/anaconda/envs/pypy3/bin/pypy3 -m ensurepip && \
|
|
|
|
/opt/anaconda/envs/pypy3/bin/pypy3 -m pip install setuptools-rust pytest pytest-benchmark tox
|
|
|
|
fi
|
|
|
|
|
2018-07-08 21:37:44 +00:00
|
|
|
### Setup python linker flags ##################################################
|
|
|
|
|
2019-04-23 11:18:42 +00:00
|
|
|
if [[ $FEATURES == *"pypy"* ]]; then
|
|
|
|
PYTHON_BINARY="pypy3"
|
|
|
|
else
|
|
|
|
PYTHON_BINARY="python"
|
|
|
|
fi
|
|
|
|
|
|
|
|
PYTHON_LIB=$($PYTHON_BINARY -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
|
2018-07-08 21:37:44 +00:00
|
|
|
|
2018-08-04 17:55:15 +00:00
|
|
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PYTHON_LIB:$HOME/rust/lib"
|
2018-07-08 21:37:44 +00:00
|
|
|
|
2018-11-15 11:13:57 +00:00
|
|
|
echo ${LD_LIBRARY_PATH}
|
2019-03-14 23:03:53 +00:00
|
|
|
|
|
|
|
### Setup kcov #################################################################
|
|
|
|
|
|
|
|
if [ ! -f "$HOME/.cargo/bin/kcov" ]; then
|
|
|
|
if [ ! -d "$HOME/kcov/.git" ]; then
|
2019-04-18 14:41:45 +00:00
|
|
|
git clone --depth=1 https://github.com/SimonKagstrom/kcov \
|
|
|
|
--branch=v36 "$HOME/kcov"
|
2019-03-14 23:03:53 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
cd $HOME/kcov
|
|
|
|
cmake .
|
|
|
|
make
|
|
|
|
install src/kcov $HOME/.cargo/bin/kcov
|
|
|
|
cd $TRAVIS_BUILD_DIR
|
2019-08-11 06:01:22 +00:00
|
|
|
fi
|