Stream: git-wasmtime

Topic: wasmtime / PR #6737 Require wasmtime options are first wh...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2023 at 20:38):

alexcrichton opened PR #6737 from alexcrichton:easier-flags-to-wasm-program to bytecodealliance:main:

Currently the way we've configured argument parsing it's valid to execute a command such as:

wasmtime run foo.wasm -O

which is the same as:

wasmtime run -O foo.wasm

or otherwise all flags are attempted to be parsed as Wasmtime flags and an error is generated when they're not wasmtime flags. I've personally found this a bit confusing in the past and I find myself frequently executing:

wasmtime run -- foo.wasm -other -arguments

While this works my general impression is that many other "wrapper commands" don't behave this way and typically don't require -- to pass flags to the target executable. This commit reconfigures argument parsing to consider any argument after the WebAssembly module itself to be an argument to the wasm program rather than an argument to Wasmtime. This means that all Wasmtime options must come between the run command and the foo.wasm WebAssembly argument.

<!--
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 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 (Jul 17 2023 at 20:38):

alexcrichton requested itsrainy for a review on PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2023 at 20:38):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2023 at 21:01):

alexcrichton updated PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2023 at 22:05):

sunfishcode created PR review comment:

Would it be possible to move these checks for "help" etc. higher up so that they only happen if the argument comes before any "--"? So if someone really wants to run a module named "help" or whatever they could do "wasmtime -- help"?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2023 at 22:05):

sunfishcode submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2023 at 22:48):

alexcrichton updated PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2023 at 22:49):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 17 2023 at 22:49):

alexcrichton created PR review comment:

Good point! Clap is the one handling -- so it's sort of hidden from us, but I think I figured out the right clap configuration to make this work. Now wasmtime run run will work, wasmtime run won't work, but wasmtime -- run will work.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 14:00):

sunfishcode submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 14:00):

sunfishcode submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 14:00):

sunfishcode created PR review comment:

This comment is now stale.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 14:00):

sunfishcode created PR review comment:

Does this mean that we can't have top-level flags, like `wasmtime --something run foo"? I don't know of a need for top-level flags, so perhaps this is fine; I'm just trying to think ahead.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 14:10):

alexcrichton updated PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 14:10):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 14:10):

alexcrichton created PR review comment:

According to this I believe that's correct, yes.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 19:40):

sunfishcode submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 19:40):

sunfishcode created PR review comment:

Ok, Wasmtime's subcommands are sufficiently different from each other that I'm not too worried about it.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 19:40):

sunfishcode submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 19:59):

alexcrichton updated PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 19:59):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 19:59):

alexcrichton has enabled auto merge for PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 20:27):

alexcrichton updated PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2023 at 20:27):

alexcrichton has enabled auto merge for PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 19 2023 at 14:21):

alexcrichton updated PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 19 2023 at 14:22):

alexcrichton has enabled auto merge for PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 19 2023 at 15:08):

alexcrichton updated PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 19 2023 at 15:08):

alexcrichton has enabled auto merge for PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 19 2023 at 17:16):

alexcrichton updated PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 19 2023 at 18:42):

alexcrichton updated PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 19 2023 at 18:43):

alexcrichton has enabled auto merge for PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2023 at 12:24):

alexcrichton updated PR #6737.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2023 at 14:00):

alexcrichton merged PR #6737.


Last updated: Nov 22 2024 at 17:03 UTC