Skip to content

--json option for wasmtime settings command#5411

Merged
alexcrichton merged 7 commits into
bytecodealliance:mainfrom
martindevans:json_settings_format
Dec 12, 2022
Merged

--json option for wasmtime settings command#5411
alexcrichton merged 7 commits into
bytecodealliance:mainfrom
martindevans:json_settings_format

Conversation

@martindevans
Copy link
Copy Markdown
Contributor

Added a --json flag to the wasmtime settings command, as discussed in #5404. Settings data is gathered into the Settings struct, which is then printed either in human readable form (exactly the same format as before) or JSON (using serde).

I'm not very familiar with Rust, so please tell me if I've done any weird non-idiomatic things and I'll try to fix them!

 - Refactored gathering of data into a `Settings` struct which can be used in both human/machine readable paths
 - Split out human readable output to another function, it produces exactly the same result as before
…e of not needing any extra dependencies (i.e.serde), but is obviously a bit ugly.
@martindevans
Copy link
Copy Markdown
Contributor Author

I'm not quite sure what the cargo deny and cargo vet failures are indicating. I need some guidance on how to fix those failures.

@jameysharp
Copy link
Copy Markdown
Contributor

Ah, you picked newer versions of serde and serde-json than we're using in the rest of the project, and nobody has vetted those versions or their dependencies yet. If you switch to serde 1.0.94 and serde_json 1.0.26, I believe all the cargo deny/vet errors will go away.

@martindevans
Copy link
Copy Markdown
Contributor Author

Thanks, I'll try that.

@jameysharp
Copy link
Copy Markdown
Contributor

I think you'll need to re-run cargo to update Cargo.lock too. I think cargo check should be enough.

@martindevans
Copy link
Copy Markdown
Contributor Author

Looks like CI is passing this time, thanks for your help @jameysharp ❤️

Copy link
Copy Markdown
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@alexcrichton alexcrichton merged commit 8f23e5a into bytecodealliance:main Dec 12, 2022
@martindevans martindevans deleted the json_settings_format branch December 12, 2022 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants