3
26
Fork
You've already forked mere
1

Acquire the store lock in pin/profile commands before touching the store #102

Merged
jhuntwork merged 1 commit from pin-profile-store-lock into main 2026年07月10日 00:50:54 +02:00

pin add, profile create --from, profile apply, and profile delete all
create or reference store content or gc-roots without holding the
store lock that install/uninstall/generation commands already use. A
concurrent mere store clean's mark phase can miss a store path these
commands are about to reference (pin add's symlink, profile apply's
newly-installed packages before the profile root publishes) and delete
it out from under them.

Added src/cli/commands_test.zig as a new src/cli/-rooted test root
(sibling to command.zig, not under commands/) so commands/.zig
handlers are unit-testable without hitting the existing
commands/-cannot-be-a-standalone-test-root wall: a file directly under
src/cli/ can import commands/
.zig fine, since their "../types.zig"
imports stay within src/cli/'s module root either way. Added a
regression test that pre-creates a valid, real store path (so
pin.create would legitimately succeed if reached) and blocks lock
acquisition by pre-creating mere/.lock as a directory; confirmed it
fails without the fix.

pin add, profile create --from, profile apply, and profile delete all create or reference store content or gc-roots without holding the store lock that install/uninstall/generation commands already use. A concurrent mere store clean's mark phase can miss a store path these commands are about to reference (pin add's symlink, profile apply's newly-installed packages before the profile root publishes) and delete it out from under them. Added src/cli/commands_test.zig as a new src/cli/-rooted test root (sibling to command.zig, not under commands/) so commands/*.zig handlers are unit-testable without hitting the existing commands/-cannot-be-a-standalone-test-root wall: a file directly under src/cli/ can import commands/*.zig fine, since their "../types.zig" imports stay within src/cli/'s module root either way. Added a regression test that pre-creates a valid, real store path (so pin.create would legitimately succeed if reached) and blocks lock acquisition by pre-creating mere/.lock as a directory; confirmed it fails without the fix.
Acquire the store lock in pin/profile commands before touching the store
All checks were successful
/ test (pull_request) Successful in 6m50s
bab6852428
pin add, profile create --from, profile apply, and profile delete all
create or reference store content or gc-roots without holding the
store lock that install/uninstall/generation commands already use. A
concurrent mere store clean's mark phase can miss a store path these
commands are about to reference (pin add's symlink, profile apply's
newly-installed packages before the profile root publishes) and delete
it out from under them.
Added src/cli/commands_test.zig as a new src/cli/-rooted test root
(sibling to command.zig, not under commands/) so commands/*.zig
handlers are unit-testable without hitting the existing
commands/-cannot-be-a-standalone-test-root wall: a file directly under
src/cli/ can import commands/*.zig fine, since their "../types.zig"
imports stay within src/cli/'s module root either way. Added a
regression test that pre-creates a valid, real store path (so
pin.create would legitimately succeed if reached) and blocks lock
acquisition by pre-creating mere/.lock as a directory; confirmed it
fails without the fix.
jhuntwork deleted branch pin-profile-store-lock 2026年07月10日 00:51:01 +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!102
Reference in a new issue
merelinux/mere
No description provided.
Delete branch "pin-profile-store-lock"

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?