Stream: git-wasmtime

Topic: wasmtime / PR #15152 Support arbitrary CLI flags in `*.wa...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2026 at 22:47):

alexcrichton opened PR #15152 from alexcrichton:cli-flags-in-wast to bytecodealliance:main:

This commit adds support for a feature that I've long wanted the ability to specify, which is arbitrary CLI flags in *.wasts. Such tests aren't the most applicable to other runtimes but they're still quite applicable to our own runtime and testing. While ideally tests don't specify these they're quite useful for one-off scenarios and such. With this commit all of our *.wast tests can now additionally specify flags = "..." like disas tests can which will always be enabled when running the test (or fuzzing with it).

This feature is coupled in this commit with refactoring to make it more natural to implement. The main change is to centralize around the CommonOptions type in the wasmtime_cli_flags as opposed to trying to maintain a separate set of feature getters/setters/etc. This means that all test configuration options are wholly representable in a CommonOptions, and additionally required adding minor features there (such as -Wlegacy-exceptions).

Note though that test configuration is not entirely folded into flags. Like before all tests assume virtually no wasm features are enabled and start from a blank slate. Individual wasm features are still enabled one-by-one in a structured manner, and this enables should_fail calculations to understand the set of wasm features needed for a test. This means we can continue to support lots of *.wast files that are automatically expected to fail on unsupported compilers, but are still run on those compilers, all by just managing a few top-level directives.

Additionally some refactoring is added here to be able to validate that flags doesn't actually specify anything that should otherwise be structurally specified. For example flags cannot contain -Ccompiler because this is an important factor in should_fail, and that predicate needs to be able to run without the wasmtime crate (aka without CLI parsing). The purpose of flags is to contain one-off settings in tests to specifically test one configuration option or such.

Finally fuzzing is additionally updated here. When fuzzing flags specified in tests take precedent over whatever the fuzz configuration says, but otherwise fuzzing will still frob every other possible configuration flag.

The end result of this refactoring is intended to be such that more tests can be migrated from tests/all/*.rs unit tests to *.wast tests without needing harness work for wasts themselves. Instead flags = "..." can be specified and pretty much be done with it.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.md

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2026 at 22:47):

alexcrichton removed the review request for wasmtime-fuzz-reviewers from PR #15152.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2026 at 22:47):

alexcrichton requested fitzgen for a review on PR #15152.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2026 at 22:47):

alexcrichton requested wasmtime-fuzz-reviewers for a review on PR #15152.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2026 at 22:47):

alexcrichton requested wasmtime-core-reviewers for a review on PR #15152.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2026 at 22:47):

alexcrichton requested wasmtime-default-reviewers for a review on PR #15152.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2026 at 23:11):

alexcrichton updated PR #15152.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 01:44):

github-actions[bot] added the label fuzzing on PR #15152.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 02:45):

github-actions[bot] commented on PR #15152:

Subscribe to Label Action

cc @fitzgen

<details>
This issue or pull request has been labeled: "fuzzing"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 13:57):

:thumbs_up: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 13:57):

:speech_balloon: fitzgen created PR review comment:

Should this be either doc(hidden) or deprecated or something?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 13:57):

:speech_balloon: fitzgen created PR review comment:

Surprised that CI isn't failing due to lack of docs on a pub item here -- do we not have deny(missing_docs) for this crate? We should probably move that into the workspace lints...

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 13:57):

:speech_balloon: fitzgen created PR review comment:

rustfmt :-/

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 15:07):

:memo: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 15:07):

:speech_balloon: alexcrichton created PR review comment:

It could be, but as a CLI flag or a deserialization option it'll still show up. It's deprecated in Config which I think should be sufficient.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 15:09):

alexcrichton updated PR #15152.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 15:09):

:memo: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 15:09):

:speech_balloon: alexcrichton created PR review comment:

Oh looks like this was pub previously but probably unintentionally so, so I've removed that. We don't have missing_docs in our workspace lints by default, and IMO we should keep it that way since it's a bit too onerous to document everything public everywhere, but opting-in to specific crates makes sense to me, and it's not opted-in in this crate, yes.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 15:10):

alexcrichton has enabled auto merge for PR #15152.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 15:25):

alexcrichton added PR #15152 Support arbitrary CLI flags in *.wast tests to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 15:32):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 15:32):

:speech_balloon: fitzgen created PR review comment:

I feel like it is a better default though, so I think it would be better to opt crates out of it than into it.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 15:56):

github-merge-queue[bot] removed PR #15152 Support arbitrary CLI flags in *.wast tests from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 18:11):

alexcrichton updated PR #15152.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 18:12):

alexcrichton has enabled auto merge for PR #15152.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 18:35):

alexcrichton added PR #15152 Support arbitrary CLI flags in *.wast tests to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 21:26):

:check: alexcrichton merged PR #15152.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 21:26):

alexcrichton removed PR #15152 Support arbitrary CLI flags in *.wast tests from the merge queue.


Last updated: Nov 19 2026 at 20:05 UTC