Skip to content

Responding to review comments re: invoke CLI output and docs#10544

Merged
pchickey merged 1 commit intobytecodealliance:pch/invoke_wavefrom
tpmccallum:tpm/review_invoke_wave_changes
Apr 8, 2025
Merged

Responding to review comments re: invoke CLI output and docs#10544
pchickey merged 1 commit intobytecodealliance:pch/invoke_wavefrom
tpmccallum:tpm/review_invoke_wave_changes

Conversation

@tpmccallum
Copy link
Copy Markdown
Contributor

This cleans up the CLI output and docs in relation to some review comments from Alex; thanks, Alex.

Below are a few commands, for your convenience, that I ran using the new code (just so you get a sense of the output):

Calling an exported function of a module:

$ wasmtime run --invoke 'initialize' wasm_mod_test.wasm 
initialize() was called!
$ wasmtime run --invoke initialize wasm_mod_test.wasm  
initialize() was called!

Calling an exported function of a component:

$ wasmtime run --invoke 'get-answer()' wasm_answer.wasm
42

Example of not using WAVE on purpose (when calling exported function of component) so that the error appears:

$ wasmtime run --invoke 'get-answer' wasm_answer.wasm 
Error: failed to run main module `wasm_answer.wasm`
Caused by:    
    0: Failed to parse invoke 'get-answer': See https://docs.wasmtime.dev/cli-options.html#run for syntax    
    1: unexpected end of input at 10..10

@tpmccallum tpmccallum requested review from a team as code owners April 8, 2025 04:57
@tpmccallum tpmccallum requested review from fitzgen and removed request for a team April 8, 2025 04:57
@tpmccallum tpmccallum changed the base branch from main to pch/invoke_wave April 8, 2025 05:00
@github-actions github-actions bot added the wasmtime:docs Issues related to Wasmtime's documentation label Apr 8, 2025
@pchickey pchickey merged commit 3e856ee into bytecodealliance:pch/invoke_wave Apr 8, 2025
41 checks passed
pchickey pushed a commit that referenced this pull request Apr 11, 2025
github-merge-queue bot pushed a commit that referenced this pull request Apr 11, 2025
* wip

* invoke works!!!

* code motion

* more context in errors

* fix test of invoke

* Invoke wave enhancements (#10511)

* wip

* wasmtime::component::Component: add iterator of exports

* components_rec

* exports_rec gives fully qualified name

* invoke works!!!

* code motion

* more context in errors

* fix test of invoke

* Finalized enhancements for --invoke: error messages

* Testing and documenting --invoke

* Update if else re: invoke

* Updating to fix truncation possibilities in unwrap_tuple

* Add clippy annotation to resolve CI error and leave original code (that makes 2 i64 out of 1 i128 and discards extra bits).

* Format (rustfmt --edition 2021) Rust files in this PR.

* Removing duplicate code missed from previous conflict resolution

* Add more verbose documentation

* Add more verbose documentation

---------

Co-authored-by: Pat Hickey <pat@moreproductive.org>

* Convert docs and error trapping to single quote approach (#10533)

* Convert docs and error trapping to single quote approach

* Adjust the error message a little

* Respond to review (#10544)

* cli: search component for export items

---------

Co-authored-by: Timothy McCallum <mistermac2008@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:docs Issues related to Wasmtime's documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants