fix(runtime): prune embedded cache by each dir's own build profile#537
Merged
Conversation
cleanup_stale() derived the stale TTL from the running process's
BOXLITE_BUILD_PROFILE and applied it to every sibling dir in the shared
runtimes/ parent. Since release (v{VERSION}) and debug
(v{VERSION}-{HASH}) dirs share that parent, a debug binary (1h TTL)
would delete the release cache that the 7d TTL was meant to protect,
and a release binary would let debug dirs linger 7d.
Record the build profile on line 2 of the .complete stamp and classify
each dir by its own stamp during cleanup (Cargo global-cache GC model:
retention decided from the entry's own metadata, never the cleaner's
identity). Unreadable / legacy version-only / unrecognized stamps fall
back to the long TTL so a cache we cannot positively classify is never
over-deleted. Staleness timing is otherwise unchanged.
Also: make/dev.mk and make/test.mk gain a SETUP_DONE guard and a
run_integration_suites helper so the shared runtime is built once
before the integration aggregators fan out, instead of each per-suite
sub-make re-deriving the phony runtime:debug / warm-cache prereqs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cleanup_stale()selected the stale TTL from the running process'sBOXLITE_BUILD_PROFILEand applied it to every sibling dir in the sharedruntimes/parent. Release (v{VERSION}) and debug (v{VERSION}-{HASH}) caches share that parent, so a debug binary (1h TTL) would prematurely delete the release cache (intended 7d), and a release binary would let debug caches linger 7d..completestamp now records the build profile on line 2;ttl_for_stamp()classifies each dir from its own stamp during cleanup. This follows Cargo's global-cache GC model — retention is decided from the entry's own recorded metadata, not the identity of whoever runs cleanup. Unreadable / legacy version-only / unrecognized stamps conservatively fall back to the long (release) TTL, so a cache that can't be positively classified is never over-deleted. Staleness timing semantics are otherwise byte-for-byte unchanged (verified branch-by-branch).filetime;str::linesis CRLF-tolerant for Windows; noatimereliance.make/dev.mk+make/test.mkadd aSETUP_DONEguard and arun_integration_suiteshelper so the shared runtime is built once before the integration aggregators fan out, instead of each per-suite sub-make re-derivingruntime:debug/ warm-cache.Test plan
make clippy(--workspace --all-targets --all-features -- -D warnings) — clean; confirms the changed module compiles withembedded-runtimeand no dead code (validates removal of the oldstale_ttl()and that both TTL consts are still used).ttl_for_stamp_classifies_by_recorded_profile— passes all four cases:debug→1h,release→7d, legacy version-only→7d, missing stamp→7d.runtime::embeddedmodule — 4/4 tests pass, no regression.extraction_creates_complete_stampearly-returns with an empty manifest). The read/classify side is fully tested and the write is a plainformat!+fs::write. Full extraction-path coverage requiresmake test:integration:rust(VM).