Skip to content

Commit

Permalink
Require semicolons in WIT files in CI (bytecodealliance#7174)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexcrichton authored and eduardomourar committed Oct 9, 2023
1 parent 5ea11f1 commit 66fec58
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/actions/install-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/filesystem/types.wit
Original file line number Diff line number Diff line change
Expand Up @@ -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<error>) -> option<error-code>
filesystem-error-code: func(err: borrow<error>) -> option<error-code>;
}
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/io/streams.wit
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-nn/spec
2 changes: 2 additions & 0 deletions crates/wasi-nn/src/backend/openvino.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/wasi-nn/src/witx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ impl From<gen::types::TensorType> 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,
}
}
}
2 changes: 1 addition & 1 deletion crates/wasi/wit/deps/filesystem/types.wit
Original file line number Diff line number Diff line change
Expand Up @@ -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<error>) -> option<error-code>
filesystem-error-code: func(err: borrow<error>) -> option<error-code>;
}
2 changes: 1 addition & 1 deletion crates/wasi/wit/deps/io/streams.wit
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 66fec58

Please sign in to comment.