Skip to content

testing: age shared cache entries by their files, not their directory (follow-up to #14799) - #14812

Merged
TrapsterDK merged 2 commits into
mainfrom
nested-shared-last-used
Nov 24, 2026
Merged

TrapsterDK merged 2 commits into
mainfrom
nested-shared-last-used

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Follow-up to #14799 (part of #14776).

Evidence run 45347598008 on 93be889 failed a_shared_root_over_its_limit_evicts_the_least_recently_used_entry_first on macOS with extracted=true. last_used counted the entry directory's own mtime, so the stale repository the case creates (new directory, old file) looked fresh and the install base was evicted instead. Now only install bases age by their directory mtime, which the Bazel client stamps per start; other entries age by their newest file, or the directory when empty.

New unit test: a_repository_ages_by_its_files_not_its_directory. Local Bazel is broken, so the module was compiled and its 5 unit tests run with the pinned rustc 1.99.1 in a scratch crate (clippy pedantic clean); platform evidence follows.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus

Counting an entry directory's own mtime made a freshly created directory
with old files look recently used, so the over-limit harness case evicted
the install base instead of the stale repository. Only install bases age
by their directory, which the Bazel client stamps per start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["linux_x86_64","windows_x86_64","macos_arm64"] task=test scope=//tools/testing/nested/... //tools/testing:nested_bazel_harness_test

A directory holding an open file cannot be renamed on Windows, so the
install base test kept its entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["linux_x86_64","windows_x86_64","macos_arm64"] task=test scope=//tools/testing/nested/... //tools/testing:nested_bazel_harness_test

@github-actions

Copy link
Copy Markdown
Contributor

Evidence started on nested-shared-last-used: https://github.com/devhusdk/rules_dx/actions/runs/45354766452

@TrapsterDK
TrapsterDK merged commit 4df66e0 into main Nov 24, 2026
17 of 31 checks passed
@TrapsterDK
TrapsterDK deleted the nested-shared-last-used branch November 24, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant