philipc opened PR #11075 from philipc:wasm-opt to bytecodealliance:main:
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.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
philipc requested pchickey for a review on PR #11075.
philipc requested wasmtime-core-reviewers for a review on PR #11075.
alexcrichton commented on PR #11075:
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 commented on PR #11075:
wasm-opthas a-gflag 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 runwasm-opt. I don't think tests should be changing behaviour based on whetherwasm-opthappens to be in the path.I could add something to wasmtime to build a binary called
wasm-optwhich 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 commented on PR #11075:
Maybe it's best to wait for wasi-sdk to use a newer clang version so we can use --no-wasm-opt.
alexcrichton submitted PR review:
Agreed we ideally don't want to run
wasm-optat all here, and agreed tests should pass regardless of whetherwasm-optis on a system or not.This seems reasonable enough for now and while I have a hunch this may not work on Windows let's let CI tell us that insted of speculating.
alexcrichton merged PR #11075.
alexcrichton commented on PR #11075:
Hey if it works it works, we can always clean up later if needed once wasi-sdk is upgraded :+1:
Last updated: Dec 06 2025 at 06:05 UTC