Commit Graph
13 Commits
Author SHA1 Message Date
Nathan Stocks c8037a86dd fix: include a virtual workspace's root Cargo.toml in the cache key (#395)
In a virtual workspace the root `Cargo.toml` is not a package, so the cache key hashed only the
members' manifests and left out the root's `[profile]`, `[patch]` and `[workspace.dependencies]`
(#268). Editing one of those, such as a `[profile.dev]` opt-level, kept the same key: every run
restored the stale cache as an exact hit, rebuilt what the edit invalidated, and saved nothing, so
the rebuild repeated on every run until something else changed the key.

This change hashes the root manifest of the workspace `cargo metadata` reports, along with its
members' manifests. It ignores `workspace.package.version` and the paths and versions of path
dependencies in `[workspace.dependencies]`, as it already does for members, so a release version
bump still keeps the key. It also reads `Cargo.lock` from that root, so a `workspaces` entry that
points at a member directory now hashes the lockfile that builds it. A workspace whose root is a
package keeps its key, and a virtual workspace gets a new one once.
2026-10-23 09:58:52 +02:00
Arpad Borsos 9f151aca7c update dependencies, rebuild 2026-07-26 16:34:10 +02:00
eitsupi f51f967e15 fix: include cdylib/rlib/dylib/staticlib targets in build and fingerprint cleanup (#320) 2026-03-19 08:14:45 +01:00
marc0246 151eeee51b Add support for running rust-cache commands from within a Nix shell (#290) 2025-12-01 19:56:12 +01:00
MaeIsBad e306f83d21 Don't overwrite env for cargo-metadata call (#285)
In some cases(eg. if RUST_TOOLCHAIN is set and cargo
is managed by rustup) cargo metadata will behave
incorrectly if some environment variables are removed
2025-11-18 21:02:38 +01:00
Arsenii Lyashenko 7e1e2d0a10 Set empty CARGO_ENCODED_RUSTFLAGS in workspace metadata retrieval (#249) 2025-06-27 19:56:05 +02:00
Arpad Borsos 008623fb83 also cache cargo install metadata 2024-12-29 08:47:45 +01:00
Max Heller d30f1144e8 Only key by Cargo.toml and Cargo.lock files of workspace members (#180) 2023-12-03 11:57:51 +01:00
Arpad Borsos 3f2513fdf4 avoid calling cargo metadata on pre-cleanup 2022-11-03 11:26:22 +01:00
Arpad Borsos be4be3720d explicitly close dir handles, add more logging, cleanups 2022-09-04 13:10:36 +02:00
Arpad Borsos 07a2ee71bc lol, dependency check was reversed 2022-07-09 17:37:48 +02:00
Arpad Borsos 827b33fbd0 pretty printing and fix workspace package retrieval 2022-07-09 15:51:45 +02:00
Arpad Borsos 6ed4c28a7c rewrite it all 2022-07-09 15:19:29 +02:00