`generate` and `dev` emit an unloadable module with wasm-opt 132
维护者通常 1 天内回复
@coolreader18 已经在做这个了。
开始于 2026年8月27日。
评估
这个 Issue 还没有评估数据。
描述
Summary
wasm-opt 132 added the compact import section encoding and turns it on under -all.
spacetime build runs wasm-opt -all -g -O2, so the optimised module now uses that encoding and
spacetimedb can no longer parse it. Disabling the feature fixes it.
Repro
$ wasm-opt --version
wasm-opt version 132
$ spacetime --version
spacetimedb tool version 2.8.2; spacetimedb-lib version 2.8.2;
$ spacetime init compact-repro -t basic-rs --non-interactive --local
$ cd compact-repro
$ spacetime dev compact-repro --server-only -y
Compiling compact_repro v0.1.0 (.../compact-repro/spacetimedb)
Finished `release` profile [optimized] target(s) in 14.40s
Optimising module with wasm-opt...
Build complete!
Publishing...
Publishing module .../compact-repro/spacetimedb to database 'compact-repro'
Optimising module with wasm-opt...
Build finished successfully.
Uploading to http://127.0.0.1:3000 => http://127.0.0.1:3000
Checking for breaking changes...
Publishing module...
Error: failed to parse WebAssembly module: invalid leading byte (0x7e) for external kind (at offset 0xb4)
Caused by:
HTTP status server error (500 Internal Server Error) for url (http://127.0.0.1:3000/v1/database/compact-repro?host_type=Wasm)
spacetime generate fails the same way, and needs no server at all:
$ spacetime generate --lang rust --out-dir src/module_bindings --module-path spacetimedb
Generating Rust module bindings for module spacetimedb
Optimising module with wasm-opt...
Build finished successfully.
Error: failed to parse WebAssembly module
Caused by:
invalid leading byte (0x7e) for external kind (at offset 0xb4)
Error: could not extract schema
Caused by:
EOF while parsing a value at line 1 column 0
The reported byte and offset vary by module. Both 0x7e and 0x7f occur, depending on whether a
group of imports shares just its module name or its type as well.
Cause
crates/cli/src/tasks/mod.rs:
match cmd!("wasm-opt", "-all", "-g", "-O2", &wasm_path, "-o", &wasm_path_opt).run() {
-all turns on every Binaryen feature, which as of version 132 includes compact-imports. The
re-encoded import section then fails to parse in wasmtime 39 (wasmparser 0.240), which is what
loads the module in both cases above: generate via spacetimedb-standalone extract-schema, and
publish via the server's publish route.
Suggested fix
Either add --disable-compact-imports after -all if version 132 is detected, or remove -all and specify the needed features.
- 主要语言
- Rust
- 星标
- 25.2k
- 派生
- 1.1k
- 平均合并
- 3 天 17 小时
- 30 天内合并 PR
- 45
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
clockworklabs/SpacetimeDB 的其他 Issue
-
CI flake: Lints未关闭
难度 1/5 1 小时以内 新手友好度 88/100
clockworklabs/SpacetimeDB#5985 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
clockworklabs/SpacetimeDB#5943 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
clockworklabs/SpacetimeDB#5851 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
clockworklabs/SpacetimeDB#5693 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
clockworklabs/SpacetimeDB#5587 ·
维护者通常 1 天内回复
查看 clockworklabs/SpacetimeDB 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
trailofbits/dylint#2107 ·
维护者通常 1 天内回复
-
area:cli bug good first issue priority:medium
难度 2/5 1-3 小时 新手友好度 90/100
维护者通常 1 天内回复
-
arrays_zip with two same-named inputs fails with "ArrowArray struct has 2 children (expected 1)"未关闭bug requires-triage
难度 2/5 1-3 小时 新手友好度 78/100
apache/datafusion-comet#6251 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug false-positive harper-core linting
难度 2/5 1-3 小时 新手友好度 68/100
Automattic/harper#4471 ·
维护者通常 1 天内回复