From ae7fedf0b1290035641dc3524a46cd10bc1650e6 Mon Sep 17 00:00:00 2001 From: Dmitri Makarov Date: Tue, 15 Feb 2022 15:39:38 -0800 Subject: [PATCH] Extend buildkite cargo cache name to include host side rust version --- .buildkite/hooks/pre-command | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index 411bb6c121..fd898e8d34 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -13,7 +13,13 @@ export PS4="++" # eval "$(ci/channel-info.sh)" eval "$(ci/sbf-tools-info.sh)" -export CARGO_TARGET_CACHE=$HOME/cargo-target-cache/"$CHANNEL"-"$BUILDKITE_LABEL"-"$SBF_TOOLS_VERSION" +source "ci/rust-version.sh" +HOST_RUST_VERSION="$rust_stable" +pattern='^[0-9]+\.[0-9]+\.[0-9]+$' +if [[ ${HOST_RUST_VERSION} =~ ${pattern} ]]; then + HOST_RUST_VERSION="${rust_stable%.*}" +fi +export CARGO_TARGET_CACHE=$HOME/cargo-target-cache/"$CHANNEL"-"$BUILDKITE_LABEL"-"$SBF_TOOLS_VERSION"-"$HOST_RUST_VERSION" ( set -x MAX_CACHE_SIZE=18 # gigabytes