From 03ce45d93afd8ae5254da8a67bb32b9dc6bdf5a8 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Mon, 26 Nov 2018 17:54:40 -0800 Subject: [PATCH] Fix snap build --- ci/snap.sh | 9 +++------ ci/test-bench.sh | 10 +++------- ci/test-large-network.sh | 10 ++++------ ci/test-stable-perf.sh | 12 ++++-------- ci/version-check-with-upgrade.sh | 11 +++++++++++ 5 files changed, 25 insertions(+), 27 deletions(-) create mode 100755 ci/version-check-with-upgrade.sh diff --git a/ci/snap.sh b/ci/snap.sh index d53050018..814811700 100755 --- a/ci/snap.sh +++ b/ci/snap.sh @@ -3,12 +3,9 @@ set -e cd "$(dirname "$0")/.." -if ! ci/version-check.sh stable; then - # This job doesn't run within a container, try once to upgrade tooling on a - # version check failure - rustup install stable - ci/version-check.sh stable -fi +# This job doesn't run within a container, try once to upgrade tooling on a +# version check failure +ci/version-check-with-upgrade.sh stable DRYRUN= if [[ -z $BUILDKITE_BRANCH ]]; then diff --git a/ci/test-bench.sh b/ci/test-bench.sh index e13f13f27..4935fbf91 100755 --- a/ci/test-bench.sh +++ b/ci/test-bench.sh @@ -8,13 +8,9 @@ source ci/upload_ci_artifact.sh eval "$(ci/channel-info.sh)" -if ! ci/version-check.sh nightly; then - # This job doesn't run within a container, try once to upgrade tooling on a - # version check failure - rustup install nightly - rustup default nightly - ci/version-check.sh nightly -fi +# This job doesn't run within a container, try once to upgrade tooling on a +# version check failure +ci/version-check-with-upgrade.sh nightly _() { echo "--- $*" diff --git a/ci/test-large-network.sh b/ci/test-large-network.sh index 2587d2401..74e0fb3bb 100755 --- a/ci/test-large-network.sh +++ b/ci/test-large-network.sh @@ -4,12 +4,10 @@ set -e here=$(dirname "$0") cd "$here"/.. -if ! ci/version-check.sh stable; then - # This job doesn't run within a container, try once to upgrade tooling on a - # version check failure - rustup install stable - ci/version-check.sh stable -fi +# This job doesn't run within a container, try once to upgrade tooling on a +# version check failure +ci/version-check-with-upgrade.sh stable + export RUST_BACKTRACE=1 ./fetch-perf-libs.sh diff --git a/ci/test-stable-perf.sh b/ci/test-stable-perf.sh index 4ebaec6c5..4d69f9c82 100755 --- a/ci/test-stable-perf.sh +++ b/ci/test-stable-perf.sh @@ -6,13 +6,9 @@ cd "$(dirname "$0")/.." # Clear cached json keypair files rm -rf "$HOME/.config/solana" -if ! ci/version-check.sh stable; then - # This job doesn't run within a container, try once to upgrade tooling on a - # version check failure - rustup install stable - rustup default stable - ci/version-check.sh stable -fi +# This job doesn't run within a container, try once to upgrade tooling on a +# version check failure +ci/version-check-with-upgrade.sh stable export RUST_BACKTRACE=1 export RUSTFLAGS="-D warnings" @@ -51,4 +47,4 @@ echo --- ci/localnet-sanity.sh # Assume |cargo build| has populated target/debug/ successfully. export PATH=$PWD/target/debug:$PATH USE_INSTALL=1 ci/localnet-sanity.sh -) \ No newline at end of file +) diff --git a/ci/version-check-with-upgrade.sh b/ci/version-check-with-upgrade.sh new file mode 100755 index 000000000..7f6e11bb7 --- /dev/null +++ b/ci/version-check-with-upgrade.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -e + +cd "$(dirname "$0")" + +channel=${1:-stable} +if ! ./version-check.sh "$channel"; then + rustup install "$channel" + rustup default "$channel" + ./version-check.sh "$channel" +fi