From 932d4720c0e0019fb309a6214e9f930f6bd51197 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 21 Apr 2020 09:36:02 +0200 Subject: [PATCH] ci: fix CARGO_HOME caching CARGO_HOME's semantic depends on when it's used in the pipeline: - it's the install prefix when installing Cargo - it's the crate cache location when building jobs env.sh is sourced at the start of all jobs and was overidding the CARGO_HOME path defined in the CI template for caching. Fix this by moving the prefix install path to install-rust.sh. --- .gitlab-ci.yml | 2 +- ci/env.sh | 1 - ci/install-rust.sh | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2797bbbec..8d97bcde1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,7 +35,7 @@ stages: .debian:10: variables: FDO_DISTRIBUTION_VERSION: 10 - FDO_DISTRIBUTION_TAG: '$RUST_VERSION-2020-04-16.2' + FDO_DISTRIBUTION_TAG: '$RUST_VERSION-2020-04-21.1' # Only stuff inside the repo directory can be cached # Override the CARGO_HOME variable to force its location CARGO_HOME: "${CI_PROJECT_DIR}/.cargo_home" diff --git a/ci/env.sh b/ci/env.sh index 1cd7b538c..0692b9d1b 100644 --- a/ci/env.sh +++ b/ci/env.sh @@ -1,5 +1,4 @@ export RUSTUP_HOME='/usr/local/rustup' -export CARGO_HOME='/usr/local/cargo' export PATH=$PATH:/usr/local/cargo/bin export PKG_CONFIG_PATH=/usr/local/lib/x86_64-linux-gnu/pkgconfig diff --git a/ci/install-rust.sh b/ci/install-rust.sh index 6c9924924..f4f79682b 100755 --- a/ci/install-rust.sh +++ b/ci/install-rust.sh @@ -1,4 +1,5 @@ source ./ci/env.sh +export CARGO_HOME='/usr/local/cargo' RUSTUP_VERSION=1.21.1 RUST_VERSION=$1