From c81c19234fe07b01b024ef966d7475a4ac5f3d4c Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 28 Aug 2018 20:54:05 -0700 Subject: [PATCH] Improve incremental speed of docker cargo builds outside of CI --- ci/docker-run.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ci/docker-run.sh b/ci/docker-run.sh index 507f9500ff..370f25f7ca 100755 --- a/ci/docker-run.sh +++ b/ci/docker-run.sh @@ -34,9 +34,14 @@ ARGS=( ) if [[ -n $CI ]]; then + # Share the real ~/.cargo between docker containers in CI for speed ARGS+=(--volume "$HOME:/home") - ARGS+=(--env "CARGO_HOME=/home/.cargo") +else + # Avoid sharing ~/.cargo when building locally to avoid a mixed macOS/Linux + # ~/.cargo + ARGS+=(--volume "$PWD:/home") fi +ARGS+=(--env "CARGO_HOME=/home/.cargo") # kcov tries to set the personality of the binary which docker # doesn't allow by default.