-
Notifications
You must be signed in to change notification settings - Fork 34
Fix Cargo cache key to include source checksum (v4) #1930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,8 +57,8 @@ jobs: | |
|
|
||
| - restore_cache: | ||
| keys: | ||
| - v3-cargo-{{ checksum "ext/widget_renderer/Cargo.lock" }} | ||
| - v3-cargo- | ||
| - v4-cargo-{{ checksum "ext/widget_renderer/Cargo.lock" }}-{{ checksum "ext/widget_renderer/src/template_renderer.rs" }} | ||
| - v4-cargo-{{ checksum "ext/widget_renderer/Cargo.lock" }}- | ||
|
|
||
| - run: | ||
| name: Build widget renderer (Rust) | ||
|
|
@@ -89,7 +89,7 @@ jobs: | |
| - ext/widget_renderer/target | ||
| - ~/.cargo/registry | ||
| - ~/.cargo/git | ||
| key: v3-cargo-{{ checksum "ext/widget_renderer/Cargo.lock" }} | ||
| key: v4-cargo-{{ checksum "ext/widget_renderer/Cargo.lock" }}-{{ checksum "ext/widget_renderer/src/template_renderer.rs" }} | ||
|
||
|
|
||
| # Download and cache dependencies | ||
| - restore_cache: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache key only includes the checksum of
template_renderer.rs, but the Rust project has multiple source files (form_data.rs,lib.rs, andtemplate_renderer.rs). Changes toform_data.rsorlib.rswould not invalidate the cache, potentially causing stale builds. Consider using a checksum of the entiresrcdirectory or all.rsfiles instead of justtemplate_renderer.rs. CircleCI supports checksumming directories, e.g.,checksum "ext/widget_renderer/src"which would hash all files in the directory.