Skip to content

feat(wasip3): implement wasi:filesystem #11406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

rvolosatovs
Copy link
Member

@rvolosatovs rvolosatovs commented Aug 8, 2025

Refs bytecodealliance/wasip3-prototyping#228

Looks like reads will benefit from quite a bit of refactoring, which I did not manage to get to this week yet.
Keeping this open as draft for now until that's done (I'll get back to it next week)

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
for consistency with refactors for sockets

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@rvolosatovs rvolosatovs force-pushed the feat/wasip3-filesystem branch from e8f3f0c to 103ab41 Compare August 8, 2025 18:01
@github-actions github-actions bot added the wasi Issues pertaining to WASI label Aug 8, 2025
if !file.perms.contains(FilePerms::READ) {
return Err(types::ErrorCode::NotPermitted.into());
}
bail!("TODO: read_via_stream")
Copy link
Member

Choose a reason for hiding this comment

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

mind filing an issue for this if the intention is to leave this before landing?

FutureReader<Result<(), ErrorCode>>,
)> {
let dir = store.get_dir(&fd)?;
bail!("TODO: read_directory")
Copy link
Member

Choose a reason for hiding this comment

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

Similar to above, mind filing an issue for this? (unless the intention is to fill out in this PR)

Comment on lines +346 to +347
// NOTE: `Dir::rename_at` will check permissions as well, but we're doing it here early to
// preserve legacy behavior
Copy link
Member

Choose a reason for hiding this comment

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

Is this a difference from WASIp3 intentionally? Or just an artifact of a test doing two invalid things at once and which error is coming out is now different?

Comment on lines +586 to +587
atim: NewTimestamp,
mtim: NewTimestamp,
Copy link
Member

Choose a reason for hiding this comment

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

Where it makes sense for types like this I think it'd also be reasonable to use the cap-std types directly and avoid having a layer of abstraction which is wasmtime-wasi specific (e.g. directly convert bindgen-generated types to cap-std types).

I don't think it makes sense for all types, but for some like this it might be reasonable to skip the extra enum here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi Issues pertaining to WASI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants