Resource Static Methods Cause Build Failure When Imported
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- rust, wasm
调研方向
从附件中的 min-ex.zip 开始,使用 cargo component build 构建 exporter,然后构建 importer 并重现静态资源验证错误。比较 importer 的静态方法情况和普通方法情况;完成的标准是 importer 成功构建,同时保留静态资源导入。
由索引模型根据 Issue 内容生成。
描述
Hey all, I ran into an issue where I couldn't import static resource functions which were defined in another wasm component. I have a minimal example attached as a zip file below.
In the project, I have an cdylib called exporter that exports a single wit resource, called 'my-resource' with a single static method called 'get-static' which returns a string. I also have an project called importer that creates an executable that imports the resource with the static method. I find that when I build the importing package, I get the following error:
error: failed to validate component output
Caused by:
export name `[static]my-resource.get-static` is not valid
static resource name is not known in this context (at offset 0xb)
This issue doesn't happen when I change the static method to a normal method. Any idea what's going wrong here?
The steps to reproduce using the package below are as follows:
- unzip the folder.
cd exportercargo component build. You should see this output:
Generating bindings for exporter (src\bindings.rs)
Compiling wit-bindgen-rt v0.24.0
Compiling exporter v0.1.0 (C:\Users\bnhei\source\min-ex\exporter)
Finished dev [unoptimized + debuginfo] target(s) in 1.72s
Creating component target\wasm32-wasi\debug\exporter.wasm
cd ../importercargo component build. You should see this output:
Compiling wit-bindgen-rt v0.24.0
Compiling importer v0.1.0 (C:\Users\bnhei\source\min-ex\importer)
Finished dev [unoptimized + debuginfo] target(s) in 1.57s
Creating component target\wasm32-wasi\debug\importer.wasm
error: failed to validate component output
Caused by:
export name `[static]my-resource.get-static` is not valid
static resource name is not known in this context (at offset 0xb)
- 主要语言
- Rust
- 星标
- 593
- 派生
- 68
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bytecodealliance/cargo-component 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 38/100
-
难度 3/5 1-2 天 新手友好度 76/100
-
难度 5/5 一周以上 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 48/100
bytecodealliance/cargo-component#399 · 2 条评论 ·
查看 bytecodealliance/cargo-component 的全部 Issue
相似的 Issue
-
[Bug] AM Context Monitor (am-monitor): Session turns count is capped at 80 due to turns.slice(-80)未关闭
难度 2/5 1-3 小时 新手友好度 83/100
lbjlaq/Antigravity-Manager#4180 ·
维护者通常 1 天内回复
-
bug triage
难度 2/5 1-3 小时 新手友好度 78/100
zizmorcore/zizmor#2608 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 83/100
longbridge/nsh#4201 ·
维护者通常 1 天内回复