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

Find workaround for WASI's fd_readdir unsupported on NodeJS@Windows #312

Open
fzhinkin opened this issue May 6, 2024 · 5 comments
Open
Labels

Comments

@fzhinkin
Copy link
Collaborator

fzhinkin commented May 6, 2024

NodeJs does not implement WASI's fs_readdir on Windows: https://github.com/nodejs/node/blob/6f4d6011ea1b448cf21f5d363c44e4a4c56ca34c/deps/uvwasi/src/uvwasi.c#L19

We need to somehow work around the lack of support to allow file listing on Windows.

@lppedd
Copy link
Contributor

lppedd commented May 6, 2024

Did you manage to find an issue/PR that describes the why? This feels so strange.

@fzhinkin
Copy link
Collaborator Author

fzhinkin commented May 6, 2024

The top-level issue, I guess, would be: nodejs/uvwasi#11

@fzhinkin
Copy link
Collaborator Author

fzhinkin commented May 6, 2024

Although it doesn't explicitly mention an actual reason.

@lppedd
Copy link
Contributor

lppedd commented May 6, 2024

Damn that's old... Doesn't look good long term.

@fzhinkin
Copy link
Collaborator Author

fzhinkin commented May 6, 2024

Things are not that bad in the long term, I believe.

uvwasi uses telldir and seekdir to correctly support cookie parameter in WASI 0.1's fd_readdir. Neither of these functions is available on Windows.

It's possible to somehow emulate these functions on Windows, but I don't think it's worth as WASI 0.2 replaced fd_readdir with a directory stream that provides only sequential access to its entries.

So the problem should gone as soon as WASI 0.2+ will be supported.

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

No branches or pull requests

2 participants