From 7b5396d7b14d195c387a92b35050e98f18d0bc50 Mon Sep 17 00:00:00 2001 From: Joseph Birr-Pixton Date: Thu, 28 Dec 2017 15:27:38 +0000 Subject: [PATCH] use stable cargo for coverage builds --- .travis.yml | 1 + admin/coverage | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 285cc20..6fe8f3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ matrix: before_install: - if [[ "$COVERAGE" == "1" ]]; then admin/build-lcov ; fi - if [[ "$COVERAGE" == "1" ]]; then gem install coveralls-lcov ; fi + - if [[ "$COVERAGE" == "1" ]]; then rustup install stable ; fi - if [[ "$COVERAGE" == "1" ]]; then sudo apt-get install libclang-common-3.8-dev llvm-3.8-dev ; fi script: - RUST_BACKTRACE=1 cargo test diff --git a/admin/coverage b/admin/coverage index cafcbfe..fa087ce 100755 --- a/admin/coverage +++ b/admin/coverage @@ -3,7 +3,6 @@ import os import glob import subprocess -from os import path LLVM_PATH = glob.glob('/usr/lib/llvm-3.8/lib/clang/3.8.[0-9]/lib/linux/')[0] COVERAGE_OPTIONS = '-Ccodegen-units=1 -Clink-dead-code -Cpasses=insert-gcov-profiling -Zno-landing-pads -L%s -lclang_rt.profile-x86_64' % LLVM_PATH @@ -23,10 +22,15 @@ def run(which): exe = filter(lambda x: '.d' not in x, glob.glob('target/debug/' + which + '-*'))[0] sh('./' + exe) +def cargo(): + # run stable cargo, because nightly is oft-broken + out = subprocess.check_output(['rustup', 'run', 'stable', 'rustup', 'which', 'cargo']) + return out.strip() + def rustc(*args): - exe = ['cargo', 'rustc', '--all-features'] + list(args) + exe = [cargo(), 'rustc', '--all-features'] + list(args) env = dict(os.environ) - env.update(RUSTC_WRAPPER = path.abspath('./admin/coverage-rustc'), + env.update(RUSTC_WRAPPER = './admin/coverage-rustc', COVERAGE_OPTIONS = COVERAGE_OPTIONS) subprocess.check_call(exe, env = env)