Skip to content

release build produces big binary for wasm32-unknown-unknown target #53731

Closed
@mahdi-shojaee

Description

@mahdi-shojaee

The output wasm binary for release build is 1.9M for a minimal wasm crate!
Until nightly 2018-08-13 everything was fine (119B).

I tried this code:

#[no_mangle]
pub fn init() -> u32 {
    0
}

Build command:
cargo build --release --target wasm32-unknown-unknown

I expected to see this happen:
All builds must produce small binaries.

Instead, this happened:
For toolchains until nightly-2018-08-13, cargo build produces 119B wasm output that is correct. But for the newer toolchains cargo build produces 1.9M wasm output!

Meta

rustc --version --verbose:

rustc 1.30.0-nightly (7219130 2018-08-26)
binary: rustc
commit-hash: 7219130
commit-date: 2018-08-26
host: x86_64-apple-darwin
release: 1.30.0-nightly
LLVM version: 7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions