-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Conversation
abb3c65
to
9dbee33
Compare
do we have any agents running this for testing? I did some brief local testing with |
just tested it. target folder is removed by each steps
the test script#!/bin/bash
function silent_checkout() {
git checkout $1 >/dev/null 2>&1
}
function remove_target_and_build_with_target_cache() {
rm -rf target/
echo "=> pre command"
source .buildkite/hooks/pre-command >/dev/null 2>&1
echo "=> build"
time cargo +1.60.0 build --release --bins -q
echo "=> post command"
source .buildkite/hooks/post-command >/dev/null 2>&1
}
function remove_target_and_build_with_sccache() {
rm -rf target/
echo "=> build"
time RUSTC_WRAPPER=/var/lib/buildkite-agent/.cargo/bin/sccache cargo +1.60.0 build --release --bins -q
}
echo "delete all cache"
rm -rf /var/lib/buildkite-agent/cargo-target-cache/
rm -rf /var/lib/buildkite-agent/.cache/sccache/
rm -rf target/
echo "===== cargo-target-cache ====="
echo "==> checkout 134303714"
silent_checkout 134303714
remove_target_and_build_with_target_cache
echo "==> build again"
remove_target_and_build_with_target_cache
echo "==> checkout "9723a33d2
silent_checkout 9723a33d2
remove_target_and_build_with_target_cache
echo "==> checkout 134303714"
silent_checkout 134303714
remove_target_and_build_with_target_cache
echo "delete all cache"
rm -rf /var/lib/buildkite-agent/cargo-target-cache/
rm -rf /var/lib/buildkite-agent/.cache/sccache/
rm -rf target/
echo "===== sccache ====="
echo "==> checkout 134303714"
silent_checkout 134303714
remove_target_and_build_with_sccache
sccache --stop-server
echo "==> build again"
remove_target_and_build_with_sccache
sccache --stop-server
echo "==> checkout "9723a33d2
silent_checkout 9723a33d2
remove_target_and_build_with_sccache
sccache --stop-server
echo "==> checkout 134303714"
silent_checkout 134303714
remove_target_and_build_with_sccache
sccache --stop-server
|
Seems our target cache mechanism saves more time than sccache. I think if we just would like to get rid of cargo-target-cache, the result seems acceptable? If we really care about the build time, I think we can keep cargo-target-cache but store the cache on cloud storage. |
do we give it a shot? or I maybe I can try to search another way to improve our cargo-target-cache |
Might be worth trying with the sccache s3 backend? We use that for https://github.com/solana-labs/rust and it seems to work great |
Mind that depending on the signature version of the bucket you're using, you might need mozilla/sccache#1086 |
@alessandrod thank you for pointing it out! I think maybe I should force it to use v4 signature when the branch merged 🤔 |
* chore: remove CARGO_TARGET_CACHE * chore: prepare sccache env for docker container * chore: use s3 as sccache backend
related to #26171
sccache config has setup on buildkite-agent server. This PR is only for