wasi:http/service p3 component generated by wit-bindgen is rejected by wasmtime serve (wasi:http/types resource mismatch)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- rust, wasm
調査の方向性
src/lib.rs から始めて、報告されたコマンドを再現します: cargo build、wasm-tools component new、wasm-tools component wit、続いて wasmtime serve。生成された service_only.wit の import と resource の形状を wasi:http P3 WIT および関連する Wasmtime issue と比較します。生成された形状が想定どおりかどうかを確認するか、サポートされている生成モードまたは必要な互換性変更を特定できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Using wit-bindgen (crate 0.51.0) to generate a wasi:http/[email protected] component produces a valid component (wasm-tools validate passes), but the generated import shape appears incompatible with wasmtime serve.
Related wasmtime issue: https://github.com/bytecodealliance/wasmtime/issues/12714
Versions
- wit-bindgen crate:
0.51.0 - rustc:
1.92.0 - wasm-tools:
1.245.1 - wasmtime:
41.0.3
Repro
src/lib.rs:
wit_bindgen::generate!({
inline: r#"
package vibe:http-adapter;
world serviceonly {
include wasi:http/[email protected];
}
"#,
path: "<wasmtime repo>/crates/wasi-http/src/p3/wit",
world: "vibe:http-adapter/serviceonly",
pub_export_macro: true,
generate_all,
});
use exports::wasi::http::handler::Guest;
use wasi::http::types::{ErrorCode, Request, Response};
struct Component;
impl Guest for Component {
async fn handle(request: Request) -> Result<Response, ErrorCode> {
let _ = request;
Err(ErrorCode::InternalError(None))
}
}
export!(Component);
cargo build --target wasm32-unknown-unknown --release
wasm-tools component new target/wasm32-unknown-unknown/release/<crate>.wasm -o service_only.component.wasm
wasm-tools component wit service_only.component.wasm > service_only.wit
Generated service_only.wit starts as:
package root:component;
world root {
import wasi:http/[email protected];
export wasi:http/[email protected];
}
package wasi:[email protected] {
interface types {
resource request;
resource response;
...
Then wasmtime serve fails:
instance export `request` has the wrong type
resource implementation is missing
Question
Is this import/type shape expected from wit-bindgen for P3 wasi:http/service, or should wit-bindgen preserve a fuller types resource shape so hosts can link canonical wasi:http/types implementations?
If this is expected behavior, is there a recommended generation mode/flag to avoid this incompatibility?
- 主要言語
- Rust
- スター
- 1.5k
- フォーク
- 306
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 21
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bytecodealliance/wit-bindgen のほかの issue
-
gen-rust
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
bytecodealliance/wit-bindgen#1791 ·
メンテナーはふだん 1 日以内に返信
-
gen-rust
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
bytecodealliance/wit-bindgen#1790 ·
メンテナーはふだん 1 日以内に返信
-
gen-rust
難易度 3/5 半日 初心者へのやさしさ 55/100
bytecodealliance/wit-bindgen#1787 ·
メンテナーはふだん 1 日以内に返信
-
gen-c#
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
bytecodealliance/wit-bindgen#1759 ·
メンテナーはふだん 1 日以内に返信
-
Async exports never free the block of indirect parameters対応中かも @Aditya1404Sal が 37 日前に担当しました。 オープンasync
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
bytecodealliance/wit-bindgen#1757 ·
メンテナーはふだん 1 日以内に返信
bytecodealliance/wit-bindgen の issue をすべて見る
似ている issue
-
lane:collections todo:ticket
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 3 日以内に返信
-
bugfix
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
storytold/designcraft#3662 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
good first issue tooling
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Nixitov/Riptide-Native#521 ·
メンテナーはふだん 1 日以内に返信