-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hook up wasi exit code to wasmer cli #383
Conversation
…asmer into feature/wasi-return-exit-code
bors try |
abi, | ||
if let Some(cn) = &options.command_name { | ||
cn | ||
let start: Func<(), ()> = instance.func("_start").map_err(|e| format!("{:?}", e))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There doesn't seem to be agreement on _start
function yet (see linked wasi issue):
#362
This is a little out of scope of this PR but maybe we could only call _start
if it exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I wasn't sure what to do for that. Maybe we should keep as is and make a different pr for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think a separate PR.
.dyn_func("main") | ||
.map_err(|e| format!("{:?}", e))? | ||
.call(&args) | ||
.map_err(|e| format!("{:?}", e))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also sort of unrelated to this PR, I hope this becomes a command:
#281 (comment)
wasmer call file.wasm function_name arg1 arg2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good idea, we should make an issue for that.
bors r+ |
383: Hook up wasi exit code to wasmer cli r=lachlansneff a=lachlansneff Test by running: ``` > target/release/wasmer run examples/exit.wat > echo $? ``` should echo "7". Fixes (at least the exit code part) of #361. Co-authored-by: Lachlan Sneff <[email protected]>
Bump the `wasmer` dependency to pick up wasmerio#4366
Test by running:
should echo "7".
Fixes (at least the exit code part) of #361.