Skip to content
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

feat(preview1): implement fd_readdir #6453

Merged
merged 8 commits into from
May 26, 2023

Conversation

rvolosatovs
Copy link
Member

@rvolosatovs rvolosatovs commented May 25, 2023

Refs #6370 #6454

This includes a few somewhat related fixes in the host adapter, including fd_close fix bringing the host adapter almost to feature parity with component adapter.

@pchickey will handle sockets and polling, at which point this whole work should be done

@rvolosatovs rvolosatovs changed the title refactor(preview2): return deleted table values feat(preview1): implement fd_readdir May 25, 2023
@rvolosatovs rvolosatovs marked this pull request as ready for review May 25, 2023 11:14
@rvolosatovs rvolosatovs requested a review from a team as a code owner May 25, 2023 11:14
@rvolosatovs rvolosatovs requested review from itsrainy and removed request for a team May 25, 2023 11:14
@rvolosatovs
Copy link
Member Author

cc @pchickey

@rvolosatovs rvolosatovs force-pushed the feat/fd_readdir branch 2 times, most recently from 0294f48 to 8f761ba Compare May 25, 2023 11:42
@github-actions github-actions bot added the wasi Issues pertaining to WASI label May 25, 2023
@github-actions
Copy link

Subscribe to Label Action

cc @kubkon

This issue or pull request has been labeled: "wasi"

Thus the following users have been cc'd because of the following labels:

  • kubkon: wasi

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@rvolosatovs rvolosatovs marked this pull request as draft May 25, 2023 15:54
@rvolosatovs rvolosatovs force-pushed the feat/fd_readdir branch 2 times, most recently from f42b436 to 6e58532 Compare May 25, 2023 18:02
@rvolosatovs rvolosatovs force-pushed the feat/fd_readdir branch 4 times, most recently from 8f19fcc to 0498e3f Compare May 25, 2023 19:33
@rvolosatovs rvolosatovs marked this pull request as ready for review May 25, 2023 20:05
Copy link
Contributor

@pchickey pchickey left a comment

Choose a reason for hiding this comment

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

Great work!

crates/wasi/src/preview2/mod.rs Outdated Show resolved Hide resolved
(
types::Dirent {
d_next: 2u64.to_le(),
d_ino: fd_inode.to_le(), // NOTE: legacy implementation returns `fd` inode here
Copy link
Contributor

Choose a reason for hiding this comment

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

That is unfortunate, I never knew about this bug.

I am not sure what to do with this. We decided to get rid of providing .. in the entries stream in preview 2, because it doesn't really fit the capability model - a preopen doesn't have a ... I don't think we have any way to implement this correctly, so I guess we just have to hope that this bug doesn't cause problems for userland

crates/wasi/src/preview2/preview1/mod.rs Outdated Show resolved Hide resolved
crates/wasi/src/preview2/preview1/mod.rs Show resolved Hide resolved
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
duh

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
prtest:full

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 requested a review from pchickey May 26, 2023 09:21
@rvolosatovs
Copy link
Member Author

Rebased and addressed feedback @pchickey

@itsrainy itsrainy removed their request for review May 26, 2023 13:15
@pchickey pchickey added this pull request to the merge queue May 26, 2023
Merged via the queue into bytecodealliance:main with commit b7d3261 May 26, 2023
@rvolosatovs rvolosatovs deleted the feat/fd_readdir branch May 26, 2023 16:07
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