Unable to call method on resource, works in Rust guest but not JS guest
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 30/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, rust, wasm
- 领域
- tooling
调研方向
使用 cube-js 模板复现崩溃,并与正常工作的 cube-rust 模板进行比较,重点关注 game.js 第 194 行。然后检查 node_modules/@bytecodealliance/ComponentizeJS、@rune-runtime/rollup-plugin-rune 集成,以及 crates/rune/src/runtime/mod.rs:97 处报告的 trap。完成标准是 JavaScript guest 可以调用 pipeline.getBindGroupLayout(0),且不会触发 wasm unreachable trap。
由索引模型根据 Issue 内容生成。
描述
I've got a bit of a challenging one here. It's hard to trace the issue because I don't have debug information available from SpiderMonkey (will traces from the engine be available via some debug mode at some point?)
I have a repro but it requires my toolchain. Shouldn't take long to set up:
- Grab the latest
rune-clirelease from https://github.com/rune-runtime/rune/releases/tag/v0.1.11 (or usecurl -fsSL https://rune.sh/install.sh | bashto installrunelocally) -- I think you'll need a Mac for this for the time being. - Create a new directory, ie.
test& cd into it - Run
rune new game --template cube-js-- this will create a new Rune project in the current directory - Run
npm i - Run
rune run. Observe that the program crashes with [1] - In
game.js, comment out line 194 andrune runagain. Observe the program does not crash.
This invocation, pipeline.getBindGroupLayout(0) works in my Rust wasm32-wasip1 guest module (you can try it by doing rune new game --template cube-rust) Because of this, I believe there is a bug in ComponentizeJS. Without better debugging I can't say for certain.
If you need to debug the use of ComponentizeJS in my toolchain, you should refer to the module in node_modules/@bytecodealliance/ComponentizeJS, which is used by the @rune-runtime/rollup-plugin-rune Rollup plugin to build a wasm module for Rune.
[1]
Message: Game didn't initialize: error while executing at wasm backtrace:
0: 0x2f363 - <unknown>!<wasm function 451>
1: 0x2f36c - <unknown>!<wasm function 452>
2: 0x22ee52 - <unknown>!<wasm function 5253>
3: 0x7a8ac3 - <unknown>!rune:runtime/guest#init
Caused by:
wasm trap: wasm `unreachable` instruction executed
Location: crates/rune/src/runtime/mod.rs:97
Guidance is appreciated. Thanks.
- 主要语言
- Rust
- 星标
- 392
- 派生
- 54
- 平均合并
- 2 天 18 小时
- 30 天内合并 PR
- 3
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bytecodealliance/ComponentizeJS 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
enhancement
难度 4/5 3-5 天 新手友好度 56/100
-
难度 3/5 1-2 天 新手友好度 52/100
-
难度 4/5 3-5 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 48/100
bytecodealliance/ComponentizeJS#335 · 3 条评论 ·
查看 bytecodealliance/ComponentizeJS 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
state:needs triage
难度 2/5 1-3 小时 新手友好度 70/100
zed-industries/zed#64680 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 70/100
RustPython/RustPython#8802 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
TheLarkInn/aipm#2390 ·