Skip to content

Commit

Permalink
Disable CircleCI caching of target/ directory, prioritizing correctne…
Browse files Browse the repository at this point in the history
…ss (#476)

This should resolve an issue affecting the 2.7.5 release, where an old
`federation-2/target/` cache was restored from an unrelated PR branch
build (because `Cargo.lock` was the same), causing the compiled
`supergraph` binary to call `op_composition_result` with a string rather
than an object in some cases, triggering a panic on the Rust side.
  • Loading branch information
benjamn authored May 10, 2024
2 parents bf654c7 + eb4feff commit 0119566
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,18 +416,26 @@ commands:
type: string
default: ./
steps:
- restore_cache:
keys:
- rust-target-v2-<< parameters.platform >>-{{ checksum "Cargo.lock" }}
# After burning two release versions due to caching misbehavior, we've
# decided to disable target/ caching for now, since this repository
# publishes builds relatively infrequently, and correctness is much more
# important than build speed. If build speed does become a problem in the
# future, it should be safe to uncomment the restore_cache and save_cache
# steps below, since we bumped v2 to v3 and added {{ .Branch }} in PR #476
# but never published anything using these rules.

# - restore_cache:
# keys:
# - &target-cache-key rust-target-v3-<< parameters.platform >>-{{ .Branch }}-{{ checksum "Cargo.lock" }}

- run:
command: cargo xtask << parameters.command >> << parameters.options >>
working_directory: << parameters.working_directory >>

- save_cache:
key: rust-target-v2-<< parameters.platform >>-{{ checksum "Cargo.lock" }}
paths:
- target/
# - save_cache:
# key: *target-cache-key
# paths:
# - target/

- when:
condition:
Expand Down

0 comments on commit 0119566

Please sign in to comment.