feat(services): Add `wasi-fs` backend using `wasi:filesystem` interface
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reviewing the existing services-fs backend and the linked wasi:filesystem and Preview 2 specifications. Verify how wasi:filesystem/types, preopens, and wasi:io/streams map to the proposed backend, then build for wasm32-wasip2. Done means a services-wasi-fs backend can access host-preopened files while compiling for the target.
Written by the indexing model from the issue text.
Description
Summary
Add a new OpenDAL backend that leverages the wasi:filesystem interface for file operations. This enables OpenDAL to access the host filesystem when running as a WebAssembly component, with the host runtime (e.g., wasmtime, wasmer) providing the actual filesystem implementation.
Motivation
Currently, the services-fs backend cannot compile to wasm32-wasip2 because it depends on tokio's filesystem features, which are not supported on WASM targets.
However, WASM components can access the host filesystem through the standardized wasi:filesystem interface. A wasi-fs backend would:
- Enable filesystem access in WASM components — Components could read/write files preopened by the host runtime
- Complement existing backends —
memoryands3work on WASM, but there's no local filesystem option - Leverage existing WASI ecosystem — Runtimes like wasmtime already implement
wasi:filesystem
Proposed Implementation
A new services-wasi-fs feature/backend that:
- Imports
wasi:filesystem/typesandwasi:filesystem/preopensinterfaces - Uses
wasi:io/streamsfor read/write operations - Works with preopened directories provided by the host
- Compiles to
wasm32-wasip2target only (or conditional compilation)
Use Case
We're building WASM components that expose storage capabilities. We want to:
- Create an OpenDAL-based storage component
- Export
wasi:filesysteminterface for downstream consumers - Support multiple backends (memory, S3, and host filesystem)
Without a wasi-fs backend, components cannot access files that the host runtime preopens for them.
Research Notes
| Backend | WASM-compatible | Notes |
|---|---|---|
services-memory |
✅ | Works out of the box |
services-s3 |
✅ | Works with reqwest/reqsign |
services-fs |
❌ | Requires tokio fs (not WASM-compatible) |
services-wasi-fs |
🆕 | Proposed — uses wasi:filesystem imports |
Related
- WASI filesystem spec: https://github.com/WebAssembly/wasi-filesystem
- Preview 2 (Component Model): https://github.com/WebAssembly/WASI/blob/main/preview2/README.md
- Dominant language
- Rust
- Stars
- 5.5k
- Forks
- 869
- Avg merge
- 8h 2m
- Merged PRs (30d)
- 862
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/opendal
-
bug(services/fs): deleting "/" removes the configured root directoryPossibly taken @xgbtxy claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 81/100
apache/opendal#9635 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
core enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
apache/opendal#9572 · 1 reaction ·
Maintainers usually reply within 1 day
-
fix(bindings/nodejs): reject negative and overflowing BigInt values in WriteOptions.chunk and Read/ReaderOptions.gapPossibly taken @rohan4naik claimed this today. Openbindings/nodejs bug
Difficulty 3/5 1-2 days Newbie friendliness 76/100
apache/opendal#9569 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug(layers/throttle): throttle streaming ReadStream bytes instead of pre-charging ReadOptions::limit upper bounds on open()Possibly taken @Xuanwo claimed this today. Openbug core
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/opendal#9567 · 1 reaction ·
Maintainers usually reply within 1 day
-
bindings/c bindings/dotnet bindings/go bindings/java bindings/python bindings/ruby core integrations/object_store release release-blocker services/azblob services/azdls services/dropbox services/gcs_grpc services/git services/hf3fs services/redis services/remotestorage services/s3 website
Difficulty 5/5 Over a week Newbie friendliness 20/100
apache/opendal#9560 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
Android bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anefzaoui/misterdownloadmanager#2516 ·
Maintainers usually reply within 1 day
-
editor ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
state:triage tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 89/100
agent8-cash/ethpayserver#731 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day