Skip to content

Unable to build with --dev or --debug #1503

@osa1

Description

@osa1

wasm-pack build works, but wasm-pack --dev and wasm-pack --debug fail with:

...
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s
[INFO]: ⬇️  Installing wasm-bindgen...
error: failed getting Wasm module for '/home/omer/fir/fir/target/wasm32-unknown-unknown/debug/fir.wasm'

Caused by:
    0: failed to parse input as wasm
    1: failed to parse code section
    2: locals exceed maximum (at offset 3772351)

Stack backtrace:
   0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
   1: walrus::module::Module::parse
   2: walrus::module::config::ModuleConfig::parse
   3: wasm_bindgen_cli_support::Bindgen::generate_output
   4: wasm_bindgen_cli_support::Bindgen::generate
   5: wasm_bindgen::main
   6: std::sys_common::backtrace::__rust_begin_short_backtrace
   7: std::rt::lang_start::{{closure}}
   8: std::rt::lang_start_internal
   9: main
Error: Running the wasm-bindgen CLI
Caused by: Running the wasm-bindgen CLI
Caused by: failed to execute `wasm-bindgen`: exited with exit status: 1
  full command: "/home/omer/.cache/.wasm-pack/wasm-bindgen-55453f1f0ef1a1d5/wasm-bindgen" "/home/omer/fir/fir/target/wasm32-unknown-unknown/debug/fir.wasm" "--out-dir" "/home/omer/fir/fir/pkg" "--typescript" "--target" "bundler" "--debug"

The project: https://github.com/fir-lang/fir

It looks like walrus is unable to load the module because there's a function with too many locals. Is there a way to make an optimized (by rustc) build, but with debug info?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions