sbt/lm-core
calm b4f73c9a7b
[2.x] fix: Invalidate update cache across commands when dependencies change (#8501)
**Problem**
When project A's dependencies changed and A was compiled in one command, project B (depending on A) would not invalidate its update cache in a subsequent command. This caused stale classpaths.

The root cause was that `depsUpdated` only checked `!stats.cached`, which only detected fresh resolves within the same command. When a dependency was served from cache (even if resolved fresh in a previous command), `cached` was marked `true`, causing incorrect cache reuse.

Debug scenario from issue:
sbt:aaa> clean
sbt:aaa> a/compile
sbt:aaa> show itTests/depsUpdated
[info] * false   <-- BUG: should be true

**Solution**
Added `stamp: String` field to `UpdateStats` that records when the update was resolved. This stamp persists across commands and enables accurate cross-command comparison:

- If any dependency's stamp > our cached stamp, we re-resolve
- Falls back to `!cached` check for backwards compatibility with old caches
- Using `String` type allows future transition from timestamps to content hashes
2026-01-12 16:17:51 -05:00
..
src [2.x] fix: Invalidate update cache across commands when dependencies change (#8501) 2026-01-12 16:17:51 -05:00
NOTICE Move to lm-core, lm-ivy folders 2024-10-09 08:55:37 +02:00