Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running tests with Nightly and Coverage can cause "duplicate export name" #1475

Open
kh-aeros opened this issue Feb 11, 2025 · 0 comments
Open

Comments

@kh-aeros
Copy link

kh-aeros commented Feb 11, 2025

🐛 Bug description

When running wasm-pack with experimental WASM code coverage in release mode, the tests fail to run. The browser outputs the following:

Uncaught (in promise) CompileError: WebAssembly.instantiateStreaming(): Duplicate export name 'closure541_externref_shim' for function 2118 and function 2119 @+11708

This does not occur in Debug, so I'm assuming it's one of the optimisations that are occurring. I assume wasm-opt isn't being run by wasm-pack test, even though it builds the application too, as running wasm-pack build explicitly states that it does (and has the --no-opt switch).

There are no explicitly set release flags.

I noted that the docs say that wasm-opt is enabled by default in the release profile, but I added the following to my Cargo.toml, and the output binary was no different.

# `wasm-opt` is on by default in for the release profile, but it can be
# disabled by setting it to `false`
[package.metadata.wasm-pack.profile.release]
wasm-opt = false

🤔 Expected Behavior

WASM should not duplicate export names, and tests run successfully.

👟 Steps to reproduce

Command being run:
RUSTFLAGS='-Cinstrument-coverage -Zno-profiler-runtime --emit=llvm-ir --cfg=wasm_bindgen_unstable_test_coverage' wasm-pack test --release --chrome

🌍 Your environment

Include the relevant details of your environment.
wasm-bindgen-test version: 0.3.42
wasm-pack version: 0.13.1 (as installed by wasm-bindgen-test)
rustc version: nightly-2025-01-06-x86_64-unknown-linux-gnu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant