Skip to content

Stop returning NOTCAPABLE errors from WASI calls.#4666

Merged
sunfishcode merged 3 commits into
bytecodealliance:mainfrom
sunfishcode:stop-using-notcapable
Aug 10, 2022
Merged

Stop returning NOTCAPABLE errors from WASI calls.#4666
sunfishcode merged 3 commits into
bytecodealliance:mainfrom
sunfishcode:stop-using-notcapable

Conversation

@sunfishcode
Copy link
Copy Markdown
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
Copy Markdown

github-actions Bot commented Aug 9, 2022

Subscribe to Label Action

cc @kubkon

Details 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
Copy Markdown
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.

Comment thread crates/wasi-common/src/file.rs Outdated
Comment thread crates/wasi-common/src/dir.rs Outdated
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
Copy Markdown
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