Skip to content

Avoid running wasm-opt when compiling test programs #11075

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

philipc
Copy link
Contributor

@philipc philipc commented Jun 19, 2025

wasm-opt will strip DWARF debug info, which causes a test failure for debug::lldb::dwarf_codegen_optimized_wasm_optimized.

clang automatically runs wasm-opt if it is found in PATH and if optimization is enabled. clang-20 has a --no-wasm-opt option, but that doesn't work for wasi-sdk-25.

wasm-opt will strip DWARF debug info, which causes a test failure for
debug::lldb::dwarf_codegen_optimized_wasm_optimized.

clang automatically runs wasm-opt if it is found in PATH and if optimization
is enabled. clang-20 has a --no-wasm-opt option, but that doesn't work
for wasi-sdk-25.
@philipc philipc requested a review from a team as a code owner June 19, 2025 12:25
@philipc philipc requested review from pchickey and removed request for a team June 19, 2025 12:25
@alexcrichton
Copy link
Member

Is there a compiler flag to tell wasm-opt to preserve debuginfo we could pass? I'm a bit wary to null out PATH as I think that may cause issues on Windows and otherwise thwart detection of various tools clang might otherwise do?

@philipc
Copy link
Contributor Author

philipc commented Jun 19, 2025

wasm-opt has a -g flag which may or may not be sufficient, but I can't see a way to pass that through clang. But even if that worked, I would still prefer to not run wasm-opt. I don't think tests should be changing behaviour based on whether wasm-opt happens to be in the path.

I could add something to wasmtime to build a binary called wasm-opt which does nothing, and place that first in the path when building the test program.

Or I could change my own system to avoid the problem, but that won't fix it for others.

@philipc
Copy link
Contributor Author

philipc commented Jun 20, 2025

Maybe it's best to wait for wasi-sdk to use a newer clang version so we can use --no-wasm-opt.

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

Successfully merging this pull request may close these issues.

2 participants