Skip to content

Commit c6093fa

Browse files
authored
Merge pull request #3980 from ProvableHQ/ci/correct-cache-folder-minimal
[CI] Set correct sccache folder
2 parents 3a38e2a + 4193b40 commit c6093fa

File tree

1 file changed

+43
-28
lines changed

1 file changed

+43
-28
lines changed

.circleci/config.yml

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -77,26 +77,32 @@ commands:
7777
parameters:
7878
cache_key:
7979
type: string
80-
default: v3.3.1-rust-1.88.0-snarkos-stable-cache
80+
default: v4.2.0-rust-1.88.0-snarkos-stable-cache
8181
steps:
8282
- run: set -e
83+
- run:
84+
name: Prepare environment variables
85+
command: |
86+
# Note: sccache cache is disabled for now
87+
# it causes longer build times and causes some builds to fail
88+
89+
# echo 'export "RUSTC_WRAPPER"="$HOME/.bin/sccache"' >> $BASH_ENV
90+
# echo 'export "SCCACHE_CACHE_SIZE"="20000M"' >> $BASH_ENV
91+
# Disable incremental builds so that sccache works as expected
92+
# echo 'export CARGO_INCREMENTAL=0' >> "$BASH_ENV"
8393
- run:
8494
name: Install sccache
8595
command: |
86-
export WORK_DIR="$CIRCLE_WORKING_DIRECTORY/.cache/sccache"
87-
export SCCACHE_DIR="$CIRCLE_WORKING_DIRECTORY/.cache/sccache"
96+
export SCCACHE_DIR="$HOME/.cache/sccache"
8897
export SCCACHE_VERSION=v0.10.0
8998
export SCCACHE_PKG="sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl"
9099
91-
mkdir -p "$CIRCLE_WORKING_DIRECTORY/.bin"
100+
mkdir -p "$HOME/.bin"
92101
wget "https://github.com/mozilla/sccache/releases/download/$SCCACHE_VERSION/$SCCACHE_PKG.tar.gz"
93-
tar -C "$CIRCLE_WORKING_DIRECTORY/.bin" -xvf "$SCCACHE_PKG.tar.gz"
94-
chmod +x "$CIRCLE_WORKING_DIRECTORY/.bin/$SCCACHE_PKG/sccache"
95-
mv "$CIRCLE_WORKING_DIRECTORY/.bin/$SCCACHE_PKG/sccache" "$CIRCLE_WORKING_DIRECTORY/.bin/sccache"
96-
rm -rf "$CIRCLE_WORKING_DIRECTORY/.cargo/registry"
97-
98-
export PATH="$PATH:$CIRCLE_WORKING_DIRECTORY/.bin"
99-
export RUSTC_WRAPPER="sccache"
102+
tar -C "$HOME/.bin" -xvf "$SCCACHE_PKG.tar.gz"
103+
chmod +x "$HOME/.bin/$SCCACHE_PKG/sccache"
104+
mv "$HOME/.bin/$SCCACHE_PKG/sccache" "$HOME/.bin/sccache"
105+
rm -rf "$HOME/.cargo/registry"
100106
- run:
101107
name: Install Debian packages
102108
command: |
@@ -111,15 +117,19 @@ commands:
111117
parameters:
112118
cache_key:
113119
type: string
114-
default: v3.3.1-rust-1.88.0-snarkos-stable-cache
120+
default: v4.2.0-rust-1.88.0-snarkos-stable-cache
115121
steps:
116-
- run: (sccache -s||true)
117122
- run: set +e
123+
- run:
124+
name: "Show sccache statistics"
125+
command: $HOME/.bin/sccache -s
118126
- save_cache:
119127
key: << parameters.cache_key >>
120128
paths:
121-
- .cache/sccache
122-
- .cargo
129+
# Store the sccache files
130+
- ~/.cache/sccache
131+
# Store the cargo registry
132+
- ~/.cargo
123133

124134
run_serial:
125135
description: "Build and run tests"
@@ -134,12 +144,17 @@ commands:
134144
steps:
135145
- checkout
136146
- setup_environment:
137-
cache_key: v3.3.1-rust-1.88.0-<< parameters.cache_key >>-cache
147+
cache_key: v4.2.0-rust-1.88.0-<< parameters.cache_key >>-cache
148+
- run:
149+
name: "Build tests"
150+
no_output_timeout: 30m
151+
command: cd << parameters.workspace_member >> && RUST_MIN_STACK=67108864 cargo test << parameters.flags >> --no-run
138152
- run:
153+
name: "Run tests"
139154
no_output_timeout: 30m
140155
command: cd << parameters.workspace_member >> && RUST_MIN_STACK=67108864 cargo test << parameters.flags >>
141156
- clear_environment:
142-
cache_key: v3.3.1-rust-1.88.0-<< parameters.cache_key >>-cache
157+
cache_key: v4.2.0-rust-1.88.0-<< parameters.cache_key >>-cache
143158

144159
run_serial_long:
145160
description: "Build and run long running tests"
@@ -349,7 +364,7 @@ jobs:
349364
steps:
350365
- run_devnet:
351366
workspace_member: .
352-
cache_key: v3.3.1-rust-1.88.0-devnet-test-cache
367+
cache_key: v4.2.0-rust-1.88.0-devnet-test-cache
353368

354369
# Check crates that do not have any tests individually
355370
check-other-crates:
@@ -358,7 +373,7 @@ jobs:
358373
steps:
359374
- checkout
360375
- setup_environment:
361-
cache_key: v3.3.1-rust-1.88.0-check-other-crates-cache
376+
cache_key: v4.2.0-rust-1.88.0-check-other-crates-cache
362377
- run:
363378
name: Check snarkos-node-metrics crate
364379
no_output_timeout: 10m
@@ -368,7 +383,7 @@ jobs:
368383
no_output_timeout: 10m
369384
command: cargo check --package=snarkos-node-metrics --all-features
370385
- clear_environment:
371-
cache_key: v3.3.1-rust-1.88.0-check-other-crates-cache
386+
cache_key: v4.2.0-rust-1.88.0-check-other-crates-cache
372387

373388
check-fmt:
374389
executor: rust-docker
@@ -377,61 +392,61 @@ jobs:
377392
- checkout
378393
- install_rust_nightly
379394
- setup_environment:
380-
cache_key: v3.3.1-rust-1.88.0-fmt-cache
395+
cache_key: v4.2.0-rust-1.88.0-fmt-cache
381396
- run:
382397
name: Check style
383398
no_output_timeout: 35m
384399
command: cargo +nightly fmt --all -- --check
385400
- clear_environment:
386-
cache_key: v3.3.1-rust-1.88.0-fmt-cache
401+
cache_key: v4.2.0-rust-1.88.0-fmt-cache
387402

388403
check-unused-dependencies:
389404
executor: rust-docker
390405
resource_class: << pipeline.parameters.medium >>
391406
steps:
392407
- checkout
393408
- setup_environment:
394-
cache_key: v3.3.1-rust-1.88.0-machete-cache
409+
cache_key: v4.2.0-rust-1.88.0-machete-cache
395410
- run:
396411
name: Check for unused dependencies
397412
no_output_timeout: 10m
398413
command: |
399414
cargo install [email protected]
400415
cargo machete
401416
- clear_environment:
402-
cache_key: v3.3.1-rust-1.88.0-machete-cache
417+
cache_key: v4.2.0-rust-1.88.0-machete-cache
403418

404419
check-cargo-audit:
405420
executor: rust-docker
406421
resource_class: << pipeline.parameters.medium >>
407422
steps:
408423
- checkout
409424
- setup_environment:
410-
cache_key: v3.3.1-rust-1.88.0-cargo-audit-cache
425+
cache_key: v4.2.0-rust-1.88.0-cargo-audit-cache
411426
- run:
412427
name: Check for security vulnerabilities
413428
no_output_timeout: 10m
414429
command: |
415430
cargo install [email protected] --locked
416431
cargo audit -D warnings
417432
- clear_environment:
418-
cache_key: v3.3.1-rust-1.88.0-cargo-audit-cache
433+
cache_key: v4.2.0-rust-1.88.0-cargo-audit-cache
419434

420435
check-clippy:
421436
executor: rust-docker
422437
resource_class: << pipeline.parameters.medium >>
423438
steps:
424439
- checkout
425440
- setup_environment:
426-
cache_key: v3.3.1-rust-1.88.0-clippy-cache
441+
cache_key: v4.2.0-rust-1.88.0-clippy-cache
427442
- run:
428443
name: Check lint
429444
no_output_timeout: 35m
430445
command: |
431446
cargo clippy --workspace --all-targets -- -D warnings
432447
cargo clippy --workspace --all-targets --all-features -- -D warnings
433448
- clear_environment:
434-
cache_key: v3.3.1-rust-1.88.0-clippy-cache
449+
cache_key: v4.2.0-rust-1.88.0-clippy-cache
435450

436451
verify-windows:
437452
executor:

0 commit comments

Comments
 (0)