Skip to content

Convert docs and error trapping to single quote approach#10533

Merged
pchickey merged 2 commits intobytecodealliance:pch/invoke_wavefrom
tpmccallum:tpm/invoke_wave_changes
Apr 7, 2025
Merged

Convert docs and error trapping to single quote approach#10533
pchickey merged 2 commits intobytecodealliance:pch/invoke_wavefrom
tpmccallum:tpm/invoke_wave_changes

Conversation

@tpmccallum
Copy link
Copy Markdown
Contributor

@tpmccallum tpmccallum commented Apr 7, 2025

This PR contains proposed updates to #10054

An erroneous invocation (i.e. missing parentheses) will produce the following message:

$ wasmtime run --invoke 'get-answer' target/wasm32-wasip1/debug/wasm_answer.wasm
Error: failed to run main module `target/wasm32-wasip1/debug/wasm_answer.wasm`

Caused by:
    0: Failed to parse invoke '"get-answer"': function calls must include parentheses and must be enveloped in single quotes. For example, 'get-answer()'. String arguments must use double quotes 'get-answer("hello")', and commas must separate multiple arguments. For example, 'get-answer("Pi", 3.14)'.
    1: unexpected end of input at 10..10

@tpmccallum tpmccallum requested review from a team as code owners April 7, 2025 07:26
@tpmccallum tpmccallum requested review from alexcrichton and removed request for a team April 7, 2025 07:26
@github-actions github-actions bot added the wasmtime:docs Issues related to Wasmtime's documentation label Apr 7, 2025
@alexcrichton alexcrichton requested review from pchickey and removed request for alexcrichton April 7, 2025 14:45
@pchickey pchickey merged commit a0c4a6b into bytecodealliance:pch/invoke_wave Apr 7, 2025
pchickey pushed a commit that referenced this pull request Apr 11, 2025
* Convert docs and error trapping to single quote approach

* Adjust the error message a little
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