Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

`generate` and `dev` emit an unloadable module with wasm-opt 132

未关闭
#5,828 1 条评论 3 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

clockworklabs/SpacetimeDB 的其他 Issue

查看 clockworklabs/SpacetimeDB 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。