Skip to content

Make the fs Backend dyn-compatible#963

Open
jaybosamiya-ms wants to merge 1 commit into
jayb/fs-via-backend-part1from
jayb/fs-dyn-backend
Open

Make the fs Backend dyn-compatible#963
jaybosamiya-ms wants to merge 1 commit into
jayb/fs-via-backend-part1from
jayb/fs-dyn-backend

Conversation

@jaybosamiya-ms

Copy link
Copy Markdown
Member

#887 introduced the Backend abstraction to the file system, but as I was working on more functionality, I discovered that the better design is to guarantee that Backend is dyn-compatible, so that the composition of multiple backends can be done without a huge amount of type-level machinery + macros; it also keeps the interfaces more ergonomic for consumers of LiteBox core. To make things dyn-safe, we need to move out the Backend-specific handles; however, rather than the naive handling of this, there's a convenient abstraction such that backend implementations still end up with a largely convenient way to use their own typed handles.

@jaybosamiya-ms jaybosamiya-ms marked this pull request as ready for review June 25, 2026 00:46
@github-actions

Copy link
Copy Markdown

ℹ️ Note: This semver check was run against the jayb/fs-via-backend-part1 branch, not main or ulitebox.

🤖 SemverChecks 🤖 ⚠️ Potential breaking API changes detected ⚠️

Click for details
--- failure trait_removed_associated_type: trait's associated type was removed ---

Description:
A public trait's associated type was removed or renamed.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.48.0/src/lints/trait_removed_associated_type.ron

Failed in:
  associated type Backend::WalkingDirHandle, previously at /home/runner/work/litebox/litebox/target/semver-checks/git-jayb_fs_via_backend_part1/5cac1175baf4dacc6c4032514216dc09aa5a1c25/litebox/src/fs/backend.rs:43
  associated type Backend::FileHandle, previously at /home/runner/work/litebox/litebox/target/semver-checks/git-jayb_fs_via_backend_part1/5cac1175baf4dacc6c4032514216dc09aa5a1c25/litebox/src/fs/backend.rs:46
  associated type Backend::DirHandle, previously at /home/runner/work/litebox/litebox/target/semver-checks/git-jayb_fs_via_backend_part1/5cac1175baf4dacc6c4032514216dc09aa5a1c25/litebox/src/fs/backend.rs:49

@wdcui wdcui left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

GPT-5.5 reported the following two findings. Please double check them.

  1. litebox/src/fs/resolver.rs: O_PATH is accepted, but normal operations on those fds hit unimplemented!(), so a caller can panic LiteBox instead of getting an errno-style error such as EBADF.

  2. litebox/src/fs/devices.rs: The devices backend gives / and /dev the same (dev, ino): dev_dir_inode starts at inode 0, and root status also reports inode 0. This breaks inode identity for distinct directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants