alexcrichton opened PR #13630 from alexcrichton:remove-symbolt-able to bytecodealliance:main:
This commit adds a tunable option via
-Dsymbols={y,n}orConfig::debug_symbolsto disable generation of symbols in output*.cwasmartifacts. This can help minimize the size of an artifact to the absolute bare minimum in some scenarios.This additionally adds documentation of how to build a minimal
*.cwasmwith all the various options that can be used which affect the output artifact.<!--
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
-->
alexcrichton requested fitzgen for a review on PR #13630.
alexcrichton requested wasmtime-core-reviewers for a review on PR #13630.
alexcrichton requested wasmtime-fuzz-reviewers for a review on PR #13630.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #13630.
alexcrichton requested wasmtime-default-reviewers for a review on PR #13630.
alexcrichton edited PR #13630:
This commit adds a tunable option via
-Dsymbols={y,n}orConfig::debug_symbolsto disable generation of symbols in output*.cwasmartifacts. This can help minimize the size of an artifact to the absolute bare minimum in some scenarios.This additionally adds documentation of how to build a minimal
*.cwasmwith all the various options that can be used which affect the output artifact.Closes #10286
<!--
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
-->
github-actions[bot] added the label fuzzing on PR #13630.
github-actions[bot] added the label wasmtime:api on PR #13630.
github-actions[bot] added the label wasmtime:config on PR #13630.
github-actions[bot] added the label wasmtime:docs on PR #13630.
github-actions[bot] added the label winch on PR #13630.
github-actions[bot] commented on PR #13630:
Subscribe to Label Action
cc @fitzgen, @saulecabrera
<details>
This issue or pull request has been labeled: "fuzzing", "wasmtime:api", "wasmtime:config", "wasmtime:docs", "winch"Thus the following users have been cc'd because of the following labels:
- fitzgen: fuzzing
- saulecabrera: winch
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
github-actions[bot] commented on PR #13630:
Label Messager: wasmtime:config
It looks like you are changing Wasmtime's configuration options. Make sure to
complete this check list:
[ ] If you added a new
Configmethod, you wrote extensive documentation for
it.<details>
Our documentation should be of the following form:
```text
Short, simple summary sentence.More details. These details can be multiple paragraphs. There should be
information about not just the method, but its parameters and results as
well.Is this method fallible? If so, when can it return an error?
Can this method panic? If so, when does it panic?
Example
Optional example here.
```</details>
[ ] If you added a new
Configmethod, or modified an existing one, you
ensured that this configuration is exercised by the fuzz targets.<details>
For example, if you expose a new strategy for allocating the next instance
slot inside the pooling allocator, you should ensure that at least one of our
fuzz targets exercises that new strategy.Often, all that is required of you is to ensure that there is a knob for this
configuration option in [wasmtime_fuzzing::Config][fuzzing-config] (or one
of its nestedstructs).Rarely, this may require authoring a new fuzz target to specifically test this
configuration. See [our docs on fuzzing][fuzzing-docs] for more details.</details>
[ ] If you are enabling a configuration option by default, make sure that it
has been fuzzed for at least two weeks before turning it on by default.[fuzzing-config]: https://github.com/bytecodealliance/wasmtime/blob/ca0e8d0a1d8cefc0496dba2f77a670571d8fdcab/crates/fuzzing/src/generators.rs#L182-L194
[fuzzing-docs]: https://docs.wasmtime.dev/contributing-fuzzing.html
<details>
To modify this label's message, edit the <code>.github/label-messager/wasmtime-config.md</code> file.
To add new label messages or remove existing label messages, edit the
<code>.github/label-messager.json</code> configuration file.</details>
alexcrichton updated PR #13630.
:speech_balloon: fitzgen created PR review comment:
Maybe note at the start of this paragraph that these are implementation details that are subject to change at any time and should never be relied upon by embedders?
:thumbs_up: fitzgen submitted PR review:
r=me with below addressed
:speech_balloon: fitzgen created PR review comment:
Not obvious why it might look like that, suggest explicitly adding "because it removed ~24.75M of binary size when compiling the
.wasmto.cwasm" or some such
:speech_balloon: fitzgen created PR review comment:
Link to https://webassembly.github.io/spec/core/appendix/custom.html#name-section perhaps?
:speech_balloon: fitzgen created PR review comment:
I would rephrase "not optimized for this use case" as we have in fact been doing a lot of optimizations for this use case of the last year. It is not tuned for that use case by default, but that is pretty different from being "not optimized for" the use case (which I imagine would make many folks disregard Wasmtime for their use case).
:speech_balloon: fitzgen created PR review comment:
Is there some canonical page we can link to for minimizing Rust's binary size? Otherwise this will feel like arcane magical incantations to folks who aren't familiar with rustc flags (which is most people).
:speech_balloon: fitzgen created PR review comment:
* Pass `-Dsymbols=n` to diasble symbols used for debugging/profiling in the output artifact.
:speech_balloon: fitzgen created PR review comment:
Again, I worry that we are sharing implementation details that we don't want people to rely on. Like we can say the same thing but be more vague:
Wasmtime's
.cwasmartifacts are designed to integrate with the system's native profiler and other developer tools likewasmtime objdumpby default, but this information isn't needed to actually run the program and is safe to remove.
:speech_balloon: fitzgen created PR review comment:
I think all these will want to be
shell-sessioninstead ofbash
alexcrichton updated PR #13630.
alexcrichton commented on PR #13630:
All excellent suggestions, thanks!
alexcrichton added PR #13630 Add a tunable to remove symbols from *.cwasm files to the merge queue.
alexcrichton has enabled auto merge for PR #13630.
:check: alexcrichton merged PR #13630.
alexcrichton removed PR #13630 Add a tunable to remove symbols from *.cwasm files from the merge queue.
Last updated: Jul 29 2026 at 05:03 UTC