wasi:http/service p3 component generated by wit-bindgen is rejected by wasmtime serve (wasi:http/types resource mismatch)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- rust, wasm
- Lĩnh vực
- backend-api-design, tooling
Hướng nghiên cứu
Bắt đầu với src/lib.rs và tái hiện các lệnh đã được báo cáo: cargo build, wasm-tools component new, wasm-tools component wit, sau đó là wasmtime serve. So sánh import và dạng tài nguyên được tạo của service_only.wit với wasi:http P3 WIT và issue Wasmtime liên quan; hoàn tất khi xác định được liệu dạng được tạo có đúng như mong đợi hay đã xác định được một chế độ tạo được hỗ trợ hoặc thay đổi tương thích cần thiết.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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?
- Ngôn ngữ chính
- Rust
- Star
- 1.5k
- Fork
- 306
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 21
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bytecodealliance/wit-bindgen
-
gen-rust
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
bytecodealliance/wit-bindgen#1791 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
gen-rust
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
bytecodealliance/wit-bindgen#1790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Document build.rs approachĐang mởgen-rust
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 55/100
bytecodealliance/wit-bindgen#1787 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
gen-c#
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
bytecodealliance/wit-bindgen#1759 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Async exports never free the block of indirect parametersCó thể đã có người làm @Aditya1404Sal đã nhận 37 ngày trước. Đang mởasync
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
bytecodealliance/wit-bindgen#1757 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bytecodealliance/wit-bindgen
Issue tương tự
-
lane:collections todo:ticket
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 3 ngày
-
bugfix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
storytold/designcraft#3662 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue tooling
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Nixitov/Riptide-Native#521 ·
Maintainer thường phản hồi trong vòng 1 ngày