Browse Source

wasi-nn: bump to next snapshot (#9148)

This change removes an unnecessary constructor for error resources.
pull/9152/head
Andrew Brown 3 months ago
committed by GitHub
parent
commit
f74b14b8a7
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      ci/vendor-wit.sh
  2. 8
      crates/wasi-nn/src/wit.rs
  3. 4
      crates/wasi-nn/wit/wasi-nn.wit

2
ci/vendor-wit.sh

@ -64,6 +64,6 @@ rm -rf $cache_dir
# Separately (for now), vendor the `wasi-nn` WIT files since their retrieval is # Separately (for now), vendor the `wasi-nn` WIT files since their retrieval is
# slightly different than above. # slightly different than above.
repo=https://raw.githubusercontent.com/WebAssembly/wasi-nn repo=https://raw.githubusercontent.com/WebAssembly/wasi-nn
revision=0.2.0-rc-2024-06-25 revision=0.2.0-rc-2024-08-19
curl -L $repo/$revision/wasi-nn.witx -o crates/wasi-nn/witx/wasi-nn.witx curl -L $repo/$revision/wasi-nn.witx -o crates/wasi-nn/witx/wasi-nn.witx
curl -L $repo/$revision/wit/wasi-nn.wit -o crates/wasi-nn/wit/wasi-nn.wit curl -L $repo/$revision/wit/wasi-nn.wit -o crates/wasi-nn/wit/wasi-nn.wit

8
crates/wasi-nn/src/wit.rs

@ -329,14 +329,6 @@ impl gen::tensor::HostTensor for WasiNnView<'_> {
} }
impl gen::errors::HostError for WasiNnView<'_> { impl gen::errors::HostError for WasiNnView<'_> {
fn new(
&mut self,
_code: gen::errors::ErrorCode,
_data: String,
) -> wasmtime::Result<Resource<Error>> {
unimplemented!("this should be removed; see https://github.com/WebAssembly/wasi-nn/pull/76")
}
fn code(&mut self, error: Resource<Error>) -> wasmtime::Result<gen::errors::ErrorCode> { fn code(&mut self, error: Resource<Error>) -> wasmtime::Result<gen::errors::ErrorCode> {
let error = self.table.get(&error)?; let error = self.table.get(&error)?;
match error.code { match error.code {

4
crates/wasi-nn/wit/wasi-nn.wit

@ -1,4 +1,4 @@
package wasi:nn@0.2.0-rc-2024-06-25; package wasi:nn@0.2.0-rc-2024-08-19;
/// `wasi-nn` is a WASI API for performing machine learning (ML) inference. The API is not (yet) /// `wasi-nn` is a WASI API for performing machine learning (ML) inference. The API is not (yet)
/// capable of performing ML training. WebAssembly programs that want to use a host's ML /// capable of performing ML training. WebAssembly programs that want to use a host's ML
@ -157,8 +157,6 @@ interface errors {
} }
resource error { resource error {
constructor(code: error-code, data: string);
/// Return the error code. /// Return the error code.
code: func() -> error-code; code: func() -> error-code;

Loading…
Cancel
Save