Fix lore-revision vfs feature: forward-port projfs/serve.rs to the public crate APIs#83
Fix lore-revision vfs feature: forward-port projfs/serve.rs to the public crate APIs#83kelvincai522 wants to merge 1 commit into
Conversation
The `vfs` feature (lore-revision/vfs) does not compile in the open-source
tree: lore-revision/src/projfs/serve.rs was imported as an unmodified copy
from the private repo ("Initial code copy from private repo") and never built
against the public crate APIs, so `--features lore-revision/vfs` fails on
Windows with 8 errors. Adapt serve.rs to the current public APIs:
- From<GUID> for Context violated the orphan rule (both types are foreign now
that Context lives in lore_storage) -> inline the transmute_copy into the
existing context_from_guid() helper.
- VirtualLayer module.path is now Option<PathBuf> -> .as_deref().expect() (x4).
- serve() returns () -> handle repository.require_path() inline instead of `?`.
- require_path()? inside the i32/HRESULT ProjFS callback -> map_err to a named
E_INVALIDARG (no implicit InvalidArguments -> i32 conversion exists).
- immutable::ReadOptions re-export is private -> lore_storage::options::ReadOptions.
- Drop the now-unused crate::repository::DOT_URC import.
With this, `cargo build --release --features lore-revision/vfs` succeeds and
`lore clone --virtual` serves a ProjFS mount that hydrates files lazily
(verified: a 15.7 GB logical tree materialized at ~0.4 MB on disk; opening a
file pulls down only that file).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Kelvin Cai <[email protected]>
a4aa279 to
1014ed1
Compare
|
Sharing some follow-on VFS work that builds on this PR — for context only, not to expand this PR (it should stay the focused compile-fix). On top of this forward-port I've prototyped a FUSE backend for FUSE provider (
Two things that look like core-VFS / roadmap territory rather than provider bugs (same on ProjFS and FUSE):
Once this PR lands I can rebase the FUSE work onto main (so the projfs forward-port drops out of its diff) and open it as a separate PR. Mainly wanted to surface the direction and get your read on the avoid-sync behavior question. |
Problem
lore-revision/src/projfs/serve.rs(the Windows ProjFS provider behindlore clone --virtual) was imported as an unmodified "Initial code copy from private repo" and has never compiled in the open-source tree. Building with thevfsfeature fails on Windows:with 8 errors, because the surrounding public crates moved on while
serve.rsstayed frozen.Fix
Adapt
serve.rsto the current public APIs (no behavior change):From<GUID> for Contextviolated the orphan rule (both types are foreign now thatContextlives inlore_storage) → inline the existingtransmute_copyintocontext_from_guid().VirtualLayer.module.pathisOption<PathBuf>→.as_deref().expect()(×4).serve()returns()→ handlerepository.require_path()inline instead of?.require_path()?in the i32/HRESULT ProjFS callback →map_errto a namedE_INVALIDARG.immutable::ReadOptions→lore_storage::options::ReadOptions.DOT_URCimport.Verification
Built
--release --features lore-revision/vfson Windows (MSVC).lore clone --virtualthen serves a ProjFS mount that hydrates lazily: a ~15.7 GB logical tree materialized at ~0.4 MB on disk, and opening a single file pulled down only that file (placeholder → hydrated, ~110 ms).Scope: Windows/ProjFS only (
#[cfg(all(target_family = "windows", feature = "vfs"))]).