Bring back cap-async-std as cap-tokio#414
Open
Ericson2314 wants to merge 1 commit into
Open
Conversation
Fixes bytecodealliance#408 I don't know enough about to `tokio` to really be the person that does this, but it does compile for me. This was based on reverting commit ecc886d.
Ericson2314
added a commit
to nix-community/harmonia
that referenced
this pull request
May 11, 2026
…p-tokio` Introduces three new crates implementing a generic async file tree abstraction mirroring nix's `SourceAccessor` / `FileSystemObjectSink` architecture (NixOS/nix#15392): **`harmonia-file-core`**: Generic types (`FileTree`, `FileSystemObject`), async traits (`FileSystemSource`, `FileSystemSink`, `DirectorySink`, `RegularFileSink`), in-memory implementation, listing functions, and serde matching `nix nar ls --json`. **`harmonia-file-fd`**: Filesystem `FileSystemSource` (`DirSource`) and `FileSystemSink` (`DirSlotSink`) via `cap-tokio`. Uses `openat`/`fstatat`, mmap for large files. Lazy child thunks — directory handles opened on demand. **`harmonia-file-nar`** (renamed from `harmonia-nar`): NAR dump/restore now goes through `FileSystemSource`/`FileSystemSink` traits via `dump_source` and `restore_to_sink`. The old `walkdir`-based `NarDumper` and direct-IO `NarRestorer` are replaced. `parse_nar_listing` produces `FileTree<NarFileInfo>` from NAR streams. Other changes: - `harmonia-cache/narlist.rs` uses `DirSource` + `list_deep` (async, no `spawn_blocking`) - All harmonia workspace deps use `{ workspace = true }` - Dependency diagram groups `file-*` crates, shows isolated nodes - Architecture docs updated - Uses `cap-tokio` (bytecodealliance/cap-std#414) for async capability-based filesystem access
Ericson2314
added a commit
to nix-community/harmonia
that referenced
this pull request
May 11, 2026
…p-tokio` Introduces three new crates implementing a generic async file tree abstraction mirroring nix's `SourceAccessor` / `FileSystemObjectSink` architecture (NixOS/nix#15392): **`harmonia-file-core`**: Generic types (`FileTree`, `FileSystemObject`), async traits (`FileSystemSource`, `FileSystemSink`, `DirectorySink`, `RegularFileSink`), in-memory implementation, listing functions, and serde matching `nix nar ls --json`. **`harmonia-file-fd`**: Filesystem `FileSystemSource` (`DirSource`) and `FileSystemSink` (`DirSlotSink`) via `cap-tokio`. Uses `openat`/`fstatat`, mmap for large files. Lazy child thunks — directory handles opened on demand. **`harmonia-file-nar`** (renamed from `harmonia-nar`): NAR dump/restore now goes through `FileSystemSource`/`FileSystemSink` traits via `dump_source` and `restore_to_sink`. The old `walkdir`-based `NarDumper` and direct-IO `NarRestorer` are replaced. `parse_nar_listing` produces `FileTree<NarFileInfo>` from NAR streams. Other changes: - `harmonia-cache/narlist.rs` uses `DirSource` + `list_deep` (async, no `spawn_blocking`) - All harmonia workspace deps use `{ workspace = true }` - Dependency diagram groups `file-*` crates, shows isolated nodes - Architecture docs updated - Uses `cap-tokio` (bytecodealliance/cap-std#414) for async capability-based filesystem access
Ericson2314
added a commit
to nix-community/harmonia
that referenced
this pull request
May 11, 2026
…p-tokio` Introduces three new crates implementing a generic async file tree abstraction mirroring nix's `SourceAccessor` / `FileSystemObjectSink` architecture (NixOS/nix#15392): **`harmonia-file-core`**: Generic types (`FileTree`, `FileSystemObject`), async traits (`FileSystemSource`, `FileSystemSink`, `DirectorySink`, `RegularFileSink`), in-memory implementation, listing functions, and serde matching `nix nar ls --json`. **`harmonia-file-fd`**: Filesystem `FileSystemSource` (`DirSource`) and `FileSystemSink` (`DirSlotSink`) via `cap-tokio`. Uses `openat`/`fstatat`, mmap for large files. Lazy child thunks — directory handles opened on demand. **`harmonia-file-nar`** (renamed from `harmonia-nar`): NAR dump/restore now goes through `FileSystemSource`/`FileSystemSink` traits via `dump_source` and `restore_to_sink`. The old `walkdir`-based `NarDumper` and direct-IO `NarRestorer` are replaced. `parse_nar_listing` produces `FileTree<NarFileInfo>` from NAR streams. Other changes: - `harmonia-cache/narlist.rs` uses `DirSource` + `list_deep` (async, no `spawn_blocking`) - All harmonia workspace deps use `{ workspace = true }` - Dependency diagram groups `file-*` crates, shows isolated nodes - Architecture docs updated - Uses `cap-tokio` (bytecodealliance/cap-std#414) for async capability-based filesystem access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #408
I don't know enough about to
tokioto really be the person that does this, but it does compile for me.This was based on reverting commit ecc886d.