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

Stop returning NOTCAPABLE errors from WASI calls. #4666

Merged
merged 3 commits into from
Aug 10, 2022

Conversation

sunfishcode
Copy link
Member

ENOTCAPABLE was an error code that is used as part of the rights
system, from CloudABI. There is a set of flags associated with each file
descriptor listing which operations can be performed with the file
descriptor, and if an attempt is made to perform an operation with a
file descriptor that isn't permitted by its rights flags, it fails with
ENOTCAPABLE.

WASI is removing the rights system. For example, WebAssembly/wasi-libc#294
removed support for translating ENOTCAPABLE into POSIX error codes, on
the assumption that engines should stop using it.

So as another step to migrating away from the rights system, remove uses
of the ENOTCAPABLE error.

`ENOTCAPABLE` was an error code that is used as part of the rights
system, from CloudABI. There is a set of flags associated with each file
descriptor listing which operations can be performed with the file
descriptor, and if an attempt is made to perform an operation with a
file descriptor that isn't permitted by its rights flags, it fails with
`ENOTCAPABLE`.

WASI is removing the rights system. For example, WebAssembly/wasi-libc#294
removed support for translating `ENOTCAPABLE` into POSIX error codes, on
the assumption that engines should stop using it.

So as another step to migrating away from the rights system, remove uses
of the `ENOTCAPABLE` error.
@sunfishcode sunfishcode force-pushed the stop-using-notcapable branch from 0ccfbbb to 7138042 Compare August 9, 2022 23:17
@github-actions github-actions bot added the wasi Issues pertaining to WASI label Aug 9, 2022
@github-actions
Copy link

github-actions bot commented Aug 9, 2022

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.

Copy link
Contributor

@jameysharp jameysharp left a comment

Choose a reason for hiding this comment

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

I've made suggestions that I think are easier to read at a glance because they don't duplicate the context calls (bonus, they're one line shorter in each case) but this looks good to me either way.

crates/wasi-common/src/file.rs Outdated Show resolved Hide resolved
crates/wasi-common/src/dir.rs Outdated Show resolved Hide resolved
sunfishcode and others added 2 commits August 10, 2022 12:01
Co-authored-by: Jamey Sharp <jamey@minilop.net>
Co-authored-by: Jamey Sharp <jamey@minilop.net>
@sunfishcode
Copy link
Member Author

Good call, I applied both your suggestions 😄.

@sunfishcode sunfishcode merged commit 918debf into bytecodealliance:main Aug 10, 2022
@sunfishcode sunfishcode deleted the stop-using-notcapable branch August 10, 2022 20:44
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