Skip to content
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

Merged
merged 6 commits into from
Apr 23, 2019
Merged

Conversation

lachlansneff
Copy link
Contributor

@lachlansneff lachlansneff commented Apr 22, 2019

Test by running:

> target/release/wasmer run examples/exit.wat
> echo $?

should echo "7".

Fixes (at least the exit code part) of #361.

@lachlansneff
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Apr 22, 2019
abi,
if let Some(cn) = &options.command_name {
cn
let start: Func<(), ()> = instance.func("_start").map_err(|e| format!("{:?}", e))?;
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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))?;
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

bors bot commented Apr 23, 2019

@lachlansneff
Copy link
Contributor Author

bors r+

bors bot added a commit that referenced this pull request Apr 23, 2019
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 <lachlan.sneff@gmail.com>
@bors
Copy link
Contributor

bors bot commented Apr 23, 2019

@bors bors bot merged commit 53c576f into master Apr 23, 2019
@bors bors bot deleted the feature/wasi-return-exit-code branch April 23, 2019 00:15
surban pushed a commit to rust-wasi-web/wwrr that referenced this pull request Nov 9, 2024
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