feat(services): Add `wasi-fs` backend using `wasi:filesystem` interface

Abierto
#7,004 3 comentarios 4 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

  • #1 de @JMLX42 — cerrado sin fusionar
  • #7005 de @JMLX42 — cerrado sin fusionar

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
rust, wasm
Área
backend

Línea de trabajo

Comienza revisando el backend services-fs existente y las especificaciones enlazadas wasi:filesystem y Preview 2. Verifica cómo wasi:filesystem/types, preopens y wasi:io/streams se asignan al backend propuesto y, después, compila para wasm32-wasip2. Se considera terminado cuando un backend services-wasi-fs puede acceder a archivos preabiertos por el host mientras se compila para el objetivo.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement releases-note/feat rust
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:

  1. Enable filesystem access in WASM components — Components could read/write files preopened by the host runtime
  2. Complement existing backends — memory and s3 work on WASM, but there's no local filesystem option
  3. Leverage existing WASI ecosystem — Runtimes like wasmtime already implement wasi:filesystem
Proposed Implementation

A new services-wasi-fs feature/backend that:

  • Imports wasi:filesystem/types and wasi:filesystem/preopens interfaces
  • Uses wasi:io/streams for read/write operations
  • Works with preopened directories provided by the host
  • Compiles to wasm32-wasip2 target only (or conditional compilation)
Use Case

We're building WASM components that expose storage capabilities. We want to:

  1. Create an OpenDAL-based storage component
  2. Export wasi:filesystem interface for downstream consumers
  3. 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
Lenguaje dominante
Rust
Estrellas
5.5k
Forks
869
Merge medio
8 h 2 min
PR fusionados (30 d)
862

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/opendal

Todos los issues de apache/opendal

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.