From dff381bfae3923555d3e40356bbc557ff7791202 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 6 Oct 2023 10:28:08 -0700 Subject: [PATCH] Require semicolons in WIT files in CI This commit updates CI to require semicolons in all WIT files and parsed WIT documents. Some minor updates were required in existing WIT files and the wasi-nn proposal was additionally updated to its latest version with semicolons. The wasi-nn update brought some minor changes to the WIT which required some minor changes here as well. --- .github/actions/install-rust/action.yml | 4 ++++ crates/wasi-http/wit/deps/filesystem/types.wit | 2 +- crates/wasi-http/wit/deps/io/streams.wit | 2 +- crates/wasi-nn/spec | 2 +- crates/wasi-nn/src/backend/openvino.rs | 2 ++ crates/wasi-nn/src/witx.rs | 2 ++ crates/wasi/wit/deps/filesystem/types.wit | 2 +- crates/wasi/wit/deps/io/streams.wit | 2 +- 8 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/actions/install-rust/action.yml b/.github/actions/install-rust/action.yml index 003c994f6dfc..a84a148f1aa5 100644 --- a/.github/actions/install-rust/action.yml +++ b/.github/actions/install-rust/action.yml @@ -61,6 +61,10 @@ runs: CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse EOF + - name: Require semicolons in WIT + shell: bash + run: echo WIT_REQUIRE_SEMICOLONS=1 >> "$GITHUB_ENV" + - name: Choose registry cache key shell: bash # Update the registry index cache at most once per day. actions/cache diff --git a/crates/wasi-http/wit/deps/filesystem/types.wit b/crates/wasi-http/wit/deps/filesystem/types.wit index 7efb7e5b3208..73b93c0b097a 100644 --- a/crates/wasi-http/wit/deps/filesystem/types.wit +++ b/crates/wasi-http/wit/deps/filesystem/types.wit @@ -806,5 +806,5 @@ interface types { /// /// Note that this function is fallible because not all stream-related /// errors are filesystem-related errors. - filesystem-error-code: func(err: borrow) -> option + filesystem-error-code: func(err: borrow) -> option; } diff --git a/crates/wasi-http/wit/deps/io/streams.wit b/crates/wasi-http/wit/deps/io/streams.wit index 81832b2da958..60ad1c33dfb0 100644 --- a/crates/wasi-http/wit/deps/io/streams.wit +++ b/crates/wasi-http/wit/deps/io/streams.wit @@ -37,7 +37,7 @@ interface streams { /// The returned string will change across platforms and hosts which /// means that parsing it, for example, would be a /// platform-compatibility hazard. - to-debug-string: func() -> string + to-debug-string: func() -> string; } /// An input bytestream. diff --git a/crates/wasi-nn/spec b/crates/wasi-nn/spec index c1f8b87e923a..e2310b860db2 160000 --- a/crates/wasi-nn/spec +++ b/crates/wasi-nn/spec @@ -1 +1 @@ -Subproject commit c1f8b87e923aedda02964c31b0e1d37e331ec402 +Subproject commit e2310b860db2ff1719c9d69816099b87e85fabdb diff --git a/crates/wasi-nn/src/backend/openvino.rs b/crates/wasi-nn/src/backend/openvino.rs index 428e0fcbd98d..be9c0250dbb7 100644 --- a/crates/wasi-nn/src/backend/openvino.rs +++ b/crates/wasi-nn/src/backend/openvino.rs @@ -163,8 +163,10 @@ fn map_tensor_type_to_precision(tensor_type: TensorType) -> openvino::Precision match tensor_type { TensorType::Fp16 => Precision::FP16, TensorType::Fp32 => Precision::FP32, + TensorType::Fp64 => Precision::FP64, TensorType::U8 => Precision::U8, TensorType::I32 => Precision::I32, + TensorType::I64 => Precision::I64, TensorType::Bf16 => todo!("not yet supported in `openvino` bindings"), } } diff --git a/crates/wasi-nn/src/witx.rs b/crates/wasi-nn/src/witx.rs index e13e2678daaa..d2f85d25f4a1 100644 --- a/crates/wasi-nn/src/witx.rs +++ b/crates/wasi-nn/src/witx.rs @@ -179,6 +179,8 @@ impl From for crate::wit::types::TensorType { gen::types::TensorType::F32 => crate::wit::types::TensorType::Fp32, gen::types::TensorType::U8 => crate::wit::types::TensorType::U8, gen::types::TensorType::I32 => crate::wit::types::TensorType::I32, + gen::types::TensorType::I64 => crate::wit::types::TensorType::I64, + gen::types::TensorType::F64 => crate::wit::types::TensorType::Fp64, } } } diff --git a/crates/wasi/wit/deps/filesystem/types.wit b/crates/wasi/wit/deps/filesystem/types.wit index 7efb7e5b3208..73b93c0b097a 100644 --- a/crates/wasi/wit/deps/filesystem/types.wit +++ b/crates/wasi/wit/deps/filesystem/types.wit @@ -806,5 +806,5 @@ interface types { /// /// Note that this function is fallible because not all stream-related /// errors are filesystem-related errors. - filesystem-error-code: func(err: borrow) -> option + filesystem-error-code: func(err: borrow) -> option; } diff --git a/crates/wasi/wit/deps/io/streams.wit b/crates/wasi/wit/deps/io/streams.wit index 81832b2da958..60ad1c33dfb0 100644 --- a/crates/wasi/wit/deps/io/streams.wit +++ b/crates/wasi/wit/deps/io/streams.wit @@ -37,7 +37,7 @@ interface streams { /// The returned string will change across platforms and hosts which /// means that parsing it, for example, would be a /// platform-compatibility hazard. - to-debug-string: func() -> string + to-debug-string: func() -> string; } /// An input bytestream.