You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rust: Add option not to cache path = cargo dependencies
Due to Earthly's layer cache code added with `COPY` (even with `--keep-ts`) can
end up with timestamps (`mtime`) corresponding to the point of creation of the
cache entry, not the current time.
However on a following build the `target` mount cache may contain builds from
other branches, with different code for those dependencies, which have a newer
`mtime`. In this case `cargo` will think it can use the cached dependency
instead of rebuilding (because the code appears older than the cached entry
under `target`).
This only affects `path` dependencies since other dependencies are versioned
(either from crates.io or from git dependencies) so cargo's cache key will
differ.
This should become unnecessary with rust-lang/cargo#14136
Copy file name to clipboardExpand all lines: rust/Earthfile
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ VERSION 0.8
3
3
# Arguments:
4
4
# - cache_prefix: Overrides cache prefix for cache IDS. Its value is exported to the build environment under the entry: $EARTHLY_CACHE_PREFIX. By default ${EARTHLY_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earthly-cargo-cache
5
5
# - keep_fingerprints (false): Instructs the following +CARGO calls to not remove the Cargo fingerprints of the source packages. Use only when source packages have been COPYed with --keep-ts option.
6
+
# - do_not_cache_path_based_dependencies (false): Instructs the following +CARGO calls to remove any path based dependencies from the target cache.
6
7
# - sweep_days (4): +CARGO uses cargo-sweep to clean build artifacts that haven't been accessed for this number of days.
0 commit comments