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

On Windows, ignore files for which full_metadata fails. #2884

Merged

Conversation

sunfishcode
Copy link
Member

On Windows, metadata computes only partial metadata results, which don't
include what WASI needs for the inode field in readdir results. cap-std
has a full_metadata function which is able to include this extra
information, however it has more strict access requirements, so it sometimes
fails even when plain metadata would succeed.

Make WASI's readdir silently skip over files that can't be accessed by
full_metadata. These files wouldn't be openable in any other way by
WASI programs, so the only benefit of listing them would be to
let applications know that they exist. This allows it to avoid failing
and avoid returning bogus results.

This is part of a fix for bytecodealliance/cap-std#169.

@github-actions github-actions bot added the wasi Issues pertaining to WASI label May 7, 2021
@github-actions
Copy link

github-actions bot commented May 7, 2021

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.

@sunfishcode sunfishcode force-pushed the sunfishcode/full-metadata-fun branch from 6eb50cc to 679c792 Compare May 7, 2021 19:09
On Windows, `metadata` computes only partial metadata results, which don't
include what WASI needs for the `inode` field in `readdir` results. cap-std
has a `full_metadata` function which is able to include this extra
information, however it has more strict access requirements, so it sometimes
fails even when plain `metadata` would succeed.

Make WASI's `readdir` silently skip over files that can't be accessed by
`full_metadata`. These files wouldn't be openable in any other way by
WASI programs, so the only benefit of listing them would be to
let applications know that they exist. This allows it to avoid failing
and avoid returning bogus results.

This is part of a fix for bytecodealliance/cap-std#169.
@sunfishcode sunfishcode force-pushed the sunfishcode/full-metadata-fun branch from 679c792 to 6ba5e16 Compare May 7, 2021 19:09
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.

Good find!

@sunfishcode sunfishcode merged commit ec5d801 into bytecodealliance:main May 7, 2021
@sunfishcode sunfishcode deleted the sunfishcode/full-metadata-fun branch May 7, 2021 21:47
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