Stream: git-wasmtime

Topic: wasmtime / PR #4666 Stop returning `NOTCAPABLE` errors fr...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 20:17):

sunfishcode opened PR #4666 from stop-using-notcapable to main:

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.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 23:17):

sunfishcode updated PR #4666 from stop-using-notcapable to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2022 at 18:59):

jameysharp submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2022 at 18:59):

jameysharp submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2022 at 18:59):

jameysharp created PR review comment:

            let err = if missing.intersects(DirCaps::READDIR) {
                Error::not_dir()
            } else {
                Error::perm()
            };
            Err(err.context(format!("desired rights {:?}, has {:?}", caps, self.caps)))

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2022 at 18:59):

jameysharp created PR review comment:

            let err = if missing.intersects(FileCaps::READ | FileCaps::WRITE) {
                // `EBADF` is a little surprising here because it's also used
                // for unknown-file-descriptor errors, but it's what POSIX uses
                // in this situation.
                Error::badf()
            } else {
                Error::perm()
            };
            Err(err.context(format!("desired rights {:?}, has {:?}", caps, self.caps)))

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2022 at 19:01):

sunfishcode updated PR #4666 from stop-using-notcapable to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2022 at 19:01):

sunfishcode updated PR #4666 from stop-using-notcapable to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2022 at 20:44):

sunfishcode merged PR #4666.


Last updated: Dec 23 2024 at 12:05 UTC