sbt/lm-coursier
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
..
definitions/src/main/scala/lmcoursier fix: Change URL usage to URI 2025-08-10 18:32:04 -04:00
metadata@95874ca5bd Move metadata to lm-coursier/metadata 2024-10-09 09:44:42 +02:00
src [2.x] fix: Invalidate update cache across commands when dependencies change (#8501) 2026-01-12 16:17:51 -05:00
NOTICE Add NOTICE and headerLicense 2024-10-11 14:32:32 +02:00