3
26
Fork
You've already forked mere
1

Don't cache a partial split-stage result under ContinueOnError #105

Merged
jhuntwork merged 1 commit from split-staging-partial-cache into main 2026年07月10日 15:02:42 +02:00

Under FailurePolicy.ContinueOnError, stageSplitPackages can skip a
sub-package that failed to stage and still return successfully (the
error is only recorded via split_staging_errors_encountered).
restoreOrStageSplitPackages unconditionally persisted that result to
the build cache regardless of the error flag. On a later rebuild with
unchanged inputs, this became a cache hit that silently restored the
same incomplete package set while reporting success, and the
cache-hit path unconditionally cleared split_staging_errors_encountered
on top of that.

Fix by skipping the persist call whenever split_staging_errors_encountered
is set, so an incomplete split-stage result is never cached and a
rebuild with the same inputs genuinely re-stages instead of silently
reusing a stale partial result.

Add a regression test that stages two packages with identical inputs
across two calls to restoreOrStageSplitPackages, forcing one package to
fail on the first call only. Verified the test fails without the fix
(the second call restores the cached 1-package result instead of
re-staging both) and passes with it.

Under FailurePolicy.ContinueOnError, stageSplitPackages can skip a sub-package that failed to stage and still return successfully (the error is only recorded via split_staging_errors_encountered). restoreOrStageSplitPackages unconditionally persisted that result to the build cache regardless of the error flag. On a later rebuild with unchanged inputs, this became a cache hit that silently restored the same incomplete package set while reporting success, and the cache-hit path unconditionally cleared split_staging_errors_encountered on top of that. Fix by skipping the persist call whenever split_staging_errors_encountered is set, so an incomplete split-stage result is never cached and a rebuild with the same inputs genuinely re-stages instead of silently reusing a stale partial result. Add a regression test that stages two packages with identical inputs across two calls to restoreOrStageSplitPackages, forcing one package to fail on the first call only. Verified the test fails without the fix (the second call restores the cached 1-package result instead of re-staging both) and passes with it.
Don't cache a partial split-stage result under ContinueOnError
All checks were successful
/ test (pull_request) Successful in 6m46s
835fbb69c4
Under FailurePolicy.ContinueOnError, stageSplitPackages can skip a
sub-package that failed to stage and still return successfully (the
error is only recorded via split_staging_errors_encountered).
restoreOrStageSplitPackages unconditionally persisted that result to
the build cache regardless of the error flag. On a later rebuild with
unchanged inputs, this became a cache hit that silently restored the
same incomplete package set while reporting success, and the
cache-hit path unconditionally cleared split_staging_errors_encountered
on top of that.
Fix by skipping the persist call whenever split_staging_errors_encountered
is set, so an incomplete split-stage result is never cached and a
rebuild with the same inputs genuinely re-stages instead of silently
reusing a stale partial result.
Add a regression test that stages two packages with identical inputs
across two calls to restoreOrStageSplitPackages, forcing one package to
fail on the first call only. Verified the test fails without the fix
(the second call restores the cached 1-package result instead of
re-staging both) and passes with it.
jhuntwork deleted branch split-staging-partial-cache 2026年07月10日 15:02:43 +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!105
Reference in a new issue
merelinux/mere
No description provided.
Delete branch "split-staging-partial-cache"

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?