Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#5,828 1 commento 3 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@coolreader18 ci sta già lavorando.

Dal 27/8/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
Rust
Stelle
25.2k
Fork
1.1k
Merge medio
3g 17h
PR unite (30g)
45

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di clockworklabs/SpacetimeDB

Tutte le issue di clockworklabs/SpacetimeDB

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.