Stream: git-wasmtime

Topic: wasmtime / issue #5404 Wasmtime Settings Machine Readable...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 09 2022 at 14:47):

martindevans opened issue #5404:

Feature

currently running wasmtime settings displays a human readable output. I propose adding a switch --machine_readable which changes the output to something more convenient to parse (e.g. JSON).

Benefit

If wasmtime is being used by other processes (e.g. our usecase has the Unity editor invoking wasmtime to precompile wasm) a machine readable output would be much more convenient to work with.

Implementation

Add this:

/// Switch output format to machine readable
#[clap(long)]
machine_readable: bool,

into the SettingsCommand struct. Modify SettingsCommand.execute to use a different display system if true.

I'm willing to open a PR for this, if it's a feature that would be accepted.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 09 2022 at 15:27):

alexcrichton commented on issue #5404:

Seems reasonable to me to add! I might recommend a --json argument to explicitly specify the format but otherwise the idea seems fine to add through a PR.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 09 2022 at 15:51):

martindevans commented on issue #5404:

Thanks. I'll try to submit a PR for a --json flag this weekend :+1:

view this post on Zulip Wasmtime GitHub notifications bot (Dec 09 2022 at 16:52):

martindevans commented on issue #5404:

Is serde available to use within this crate, or can it be added? I'm not sure what the process is for managing dependencies in wasmtime.

If that's not feasible I can just emit the JSON by hand, it's not a very complicated dataset!

view this post on Zulip Wasmtime GitHub notifications bot (Dec 09 2022 at 18:26):

alexcrichton commented on issue #5404:

Yep we've got a lot of usage of serde already, so it can be added.


Last updated: Dec 23 2024 at 12:05 UTC