3
26
Fork
You've already forked mere
1

Key the build profile cache on resolved dependency versions, not names #103

Merged
jhuntwork merged 1 commit from build-cache-dependency-versions into main 2026年07月10日 03:18:14 +02:00

computeProfileRealizeKey hashed a recipe's dependency names but never
the versions actually resolved for them. Dependency resolution is
dynamic (an unpinned "openssl" resolves to whatever's newest in the
synced repo), so a repo sync that bumps a build-time dependency to a
new version was invisible to the cache: the key stayed identical and a
stale profile tree kept getting served indefinitely.

Added install.resolveDependencyTokens, a resolve-only counterpart to
installPackagesToProfile that mirrors its exact resolution behavior
(same constraint parsing, no preferred selections) without installing
anything. restoreOrInstallDependenciesToBuildProfile now resolves
before computing the cache key, and threads the resolved {name,
content_hash} pairs through computeProfileRealizeKey instead of the
raw dependency list. Reused the same RepoCache set for the subsequent
install on a cache miss, so this costs one extra local resolve pass
rather than a second repo sync.

Added a regression test proving the key changes when a dependency's
resolved content hash changes (and stays stable when it doesn't);
confirmed it fails without the fix.

computeProfileRealizeKey hashed a recipe's dependency *names* but never the versions actually resolved for them. Dependency resolution is dynamic (an unpinned "openssl" resolves to whatever's newest in the synced repo), so a repo sync that bumps a build-time dependency to a new version was invisible to the cache: the key stayed identical and a stale profile tree kept getting served indefinitely. Added install.resolveDependencyTokens, a resolve-only counterpart to installPackagesToProfile that mirrors its exact resolution behavior (same constraint parsing, no preferred selections) without installing anything. restoreOrInstallDependenciesToBuildProfile now resolves before computing the cache key, and threads the resolved {name, content_hash} pairs through computeProfileRealizeKey instead of the raw dependency list. Reused the same RepoCache set for the subsequent install on a cache miss, so this costs one extra local resolve pass rather than a second repo sync. Added a regression test proving the key changes when a dependency's resolved content hash changes (and stays stable when it doesn't); confirmed it fails without the fix.
Key the build profile cache on resolved dependency versions, not names
All checks were successful
/ test (pull_request) Successful in 6m27s
06b2f123d3
computeProfileRealizeKey hashed a recipe's dependency *names* but never
the versions actually resolved for them. Dependency resolution is
dynamic (an unpinned "openssl" resolves to whatever's newest in the
synced repo), so a repo sync that bumps a build-time dependency to a
new version was invisible to the cache: the key stayed identical and a
stale profile tree kept getting served indefinitely.
Added install.resolveDependencyTokens, a resolve-only counterpart to
installPackagesToProfile that mirrors its exact resolution behavior
(same constraint parsing, no preferred selections) without installing
anything. restoreOrInstallDependenciesToBuildProfile now resolves
before computing the cache key, and threads the resolved {name,
content_hash} pairs through computeProfileRealizeKey instead of the
raw dependency list. Reused the same RepoCache set for the subsequent
install on a cache miss, so this costs one extra local resolve pass
rather than a second repo sync.
Added a regression test proving the key changes when a dependency's
resolved content hash changes (and stays stable when it doesn't);
confirmed it fails without the fix.
jhuntwork deleted branch build-cache-dependency-versions 2026年07月10日 03:18:15 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
merelinux/mere!103
Reference in a new issue
merelinux/mere
No description provided.
Delete branch "build-cache-dependency-versions"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?