mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #223] [MERGED] feat(overlaybd): port the crate to macOS behind a platform sys module #265
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#265
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/223
Author: @huang-jl
Created: 8/27/2026
Status: ✅ Merged
Merged: 8/31/2026
Merged by: @yingdi-shan
Base:
main← Head:hjl/overlaybd-macos-sys📝 Commits (3)
228b4d9refactor(overlaybd): abstract platform syscalls into a sys module0c8eb32feat(overlaybd): reject the sparse upper layout on macOS78165b3fix(overlaybd): reject unaligned extents when scanning a sparse source📊 Changes
23 files changed (+1958 additions, -281 deletions)
View changed files
📝
storage/overlaybd/src/backend/cache/cached_fs.rs(+6 -76)📝
storage/overlaybd/src/backend/cache/full_file_cache/cache_entry.rs(+35 -28)📝
storage/overlaybd/src/backend/cache/full_file_cache/cache_pool.rs(+7 -22)📝
storage/overlaybd/src/backend/cache/full_file_cache/cache_store.rs(+20 -3)📝
storage/overlaybd/src/backend/cache/mod.rs(+4 -1)📝
storage/overlaybd/src/backend/cache/tests.rs(+21 -30)📝
storage/overlaybd/src/backend/local.rs(+56 -114)📝
storage/overlaybd/src/dense_export.rs(+4 -1)📝
storage/overlaybd/src/image/image_file.rs(+12 -0)📝
storage/overlaybd/src/lib.rs(+1 -0)📝
storage/overlaybd/src/lsmt/file/helper.rs(+44 -0)📝
storage/overlaybd/src/lsmt/file/readwrite.rs(+17 -1)📝
storage/overlaybd/src/lsmt/file/tests.rs(+117 -5)📝
storage/overlaybd/src/lsmt/file/types.rs(+23 -0)➕
storage/overlaybd/src/sys/fs_space.rs(+116 -0)➕
storage/overlaybd/src/sys/mod.rs(+92 -0)➕
storage/overlaybd/src/sys/open_flags.rs(+87 -0)➕
storage/overlaybd/src/sys/page_cache.rs(+57 -0)➕
storage/overlaybd/src/sys/release_space.rs(+287 -0)➕
storage/overlaybd/src/sys/reserve_space.rs(+190 -0)...and 3 more files
📄 Description
What
Makes overlaybd build and pass its tests on macOS (arm64). The starting point was 25 compile errors from a cargo check on a real macOS machine, every one of them a bare libc::/nix:: call whose ABI or availability differs on Darwin.
This adds storage/overlaybd/src/sys/, split by capability rather than by platform, each file owns one portable signature plus its own per-OS imp arms. The capabilities are extended attributes (8 entry points), space release, space reservation, page-cache eviction, filesystem capacity, the direct-IO open flag, and sparse-extent trustworthiness.
Two further commits reject the sparse upper layout on macOS at all three entry points that create or open an upper, and turn a pre-existing platform-independent hazard — a source file whose size is not a multiple of 512 silently losing its tail block from the index — into an explicit error.
Why
Platform detail and overlaybd's own logic were interleaved. Syscall specifics sat inline in the cache, the LSMT layer, and the local-file backend, and the same two-phase xattr size query existed as two separately written, subtly different copies. Adding a second platform on those terms would have meant scattering cfg(target_os) through overlaybd code.
Design and behavior changes
No changes for users.
Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketarget🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.