Commit Graph

2119 Commits

Author SHA1 Message Date
Syrus Akbary
84e68fd1bd
Merge pull request #386 from wasmerio/fix/install-note
Add comma to message in install.sh
2019-04-22 23:38:17 -07:00
Brandon Fish
017d52cd8f
Add comma to message in install.sh 2019-04-22 22:37:12 -05:00
bors[bot]
a96333bbd6 Merge #384
384: Added WASI integration tests r=syrusakbary a=syrusakbary

Added WASI integration tests

Co-authored-by: Syrus <me@syrusakbary.com>
2019-04-23 03:02:08 +00:00
Syrus
da54cabafa Updated version to 0.4.0 2019-04-22 18:06:37 -07:00
Syrus
3a36768934 Added cowsay.wasm file 2019-04-22 18:04:00 -07:00
Syrus Akbary
486c43fd2f
Merge pull request #385 from wasmerio/feature/better-tar-install
Improved installer
2019-04-22 17:32:18 -07:00
Syrus Akbary
15d7056972
Merge branch 'master' into feature/better-tar-install 2019-04-22 17:27:25 -07:00
Syrus
fef38200a5 Fixed circle config 2019-04-22 17:25:00 -07:00
Syrus
addd81da19 Improved build 2019-04-22 17:22:20 -07:00
Syrus
2a1df0fdf1 Added WASI integration tests 2019-04-22 17:06:42 -07:00
bors[bot]
f104b2c324 Merge #383
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>
2019-04-23 00:03:40 +00:00
Lachlan Sneff
53c576fe48 remove run_instance function 2019-04-22 16:54:58 -07:00
Lachlan Sneff
c8937c4f26 Update changelog 2019-04-22 16:49:40 -07:00
Lachlan Sneff
2038eec4ae Merge branch 'feature/wasi-return-exit-code' of github.com:wasmerio/wasmer into feature/wasi-return-exit-code 2019-04-22 16:48:47 -07:00
Lachlan Sneff
260c0acec6 Format wasmer.rs 2019-04-22 16:48:44 -07:00
Lachlan Sneff
9c825509c8
Merge branch 'master' into feature/wasi-return-exit-code 2019-04-22 16:48:24 -07:00
Lachlan Sneff
76f4798436 Hook up wasi exit code to wasmer cli 2019-04-22 16:45:36 -07:00
bors[bot]
baae2b3826 Merge #382
382: reduce suggested backends to the ones compiled into wasmer r=MarkMcCaskey a=MarkMcCaskey

resolves #380 

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-04-22 23:15:33 +00:00
Mark McCaskey
e8b2660eb7 greatly simplify logic -- thanks Lachlan! 2019-04-22 16:14:12 -07:00
Mark McCaskey
b3dacbfc3c
Merge branch 'master' into feature/improve-backend-error-message 2019-04-22 16:09:08 -07:00
Mark McCaskey
015bf78953 update changelog 2019-04-22 16:06:22 -07:00
Mark McCaskey
51cf0d1be7 reduce suggested backends to the ones compiled into wasmer 2019-04-22 16:03:04 -07:00
bors[bot]
b7f98c8401 Merge #381
381: Hook up error propagation r=lachlansneff a=lachlansneff

You can now retrieve the error from a panicking or error-returning imported function.

Example:

```rust
#[derive(Debug)]
struct ExitCode {
    code: i32,
}

fn do_panic(_ctx: &mut Ctx) -> Result<i32, ExitCode> {
    Err(ExitCode { code: 42 })
}

// This wasm functions calls `do_panic`.
let foo: Func<(), i32> = instance.func(...)?;

let result = foo.call();

println!("result: {:?}", result);

if let Err(RuntimeError::Error { data }) = result {
    if let Ok(exit_code) = data.downcast::<ExitCode>() {
        println!("exit code: {:?}", exit_code);
    }
}
```

outputs:

```
result: Err(unknown error)
exit code: ExitCode { code: 42 }
```

Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>
2019-04-22 22:55:25 +00:00
Lachlan Sneff
ff9de181f1 Add error propagation test 2019-04-22 15:53:21 -07:00
Lachlan Sneff
14325c975e Rename internal enum to make less confusing 2019-04-22 15:36:47 -07:00
Lachlan Sneff
aa9cd84085 Update changelog 2019-04-22 15:17:47 -07:00
Lachlan Sneff
706ddabf61 Hook up error propagation 2019-04-22 15:06:40 -07:00
bors[bot]
a42b7d3815 Merge #379
379: Fix small return types. r=syrusakbary a=lachlansneff

This fixes returning integers smaller than 32bits from imported functions. Also some work on fixing returning errors from functions.

Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>
Co-authored-by: Syrus <me@syrusakbary.com>
2019-04-22 19:46:35 +00:00
Syrus
3729c4a8b8 Revert "Merge #370"
This reverts commit 48a8391f5d, reversing
changes made to 363b46eca7.
2019-04-22 12:10:39 -07:00
Syrus
878a0e6687 Partial Revert of types “Return type normalization, and change return errors from imported functions"
This reverts commit 74b6ba4eaf.

# Conflicts:
#	lib/wasi/src/syscalls/mod.rs
2019-04-22 12:09:30 -07:00
Lachlan Sneff
7940aa7e42 Fix renamed variable 2019-04-22 11:57:50 -07:00
Lachlan Sneff
ecdcab5de9 Update singlepass to renamed enum discrimant 2019-04-22 11:47:47 -07:00
Lachlan Sneff
39ebca366c Update changelog 2019-04-22 11:44:31 -07:00
Lachlan Sneff
74b6ba4eaf Return type normalization, and change return errors from imported functions 2019-04-22 11:42:52 -07:00
Lachlan Sneff
85d9ca9ad2 Add NativeWasmType trait and modify WasmExternType 2019-04-22 10:35:55 -07:00
Brandon Fish
9e93565a49 Cleanup build warnings imports and unnecessary unsafe 2019-04-20 20:37:39 -05:00
bors[bot]
6478500b8f Merge #371
371: Add more Debug impl for WASI types r=bjfish a=bjfish



Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
2019-04-20 22:41:46 +00:00
Brandon Fish
2516a1ee31
Merge branch 'master' into feature/wasi-more-debug 2019-04-20 14:22:59 -05:00
Brandon Fish
962c9c8596 Add more Debug impl for WASI types 2019-04-20 14:22:31 -05:00
Syrus
684720ab3a Merge branch 'master' into feature/tar-install-with-wapm 2019-04-20 12:17:22 -07:00
bors[bot]
48a8391f5d Merge #370
370: Fix WASI by using u32 everywhere instead of u16 r=syrusakbary a=syrusakbary

Long story short: we were seeing some undeterministic behavior when running wasmer with WASI on Linux.

It turned out we are doing some bad conversions from u16 to the inner type in the trampolines (or func type?), and this only showed up in certain systems.

This PR is a quick fix to get things running quickly, but we will proceed with a proper fix soon and revert this PR.

Note: the discovery of the bug was done by @bjfish, and this PR is just a very simple way to address it.

cc @lachlansneff 

Co-authored-by: Syrus <me@syrusakbary.com>
2019-04-20 18:56:20 +00:00
Syrus
0aa35a675b Fix WASI by using u32 everywhere instead of u16 2019-04-20 11:47:06 -07:00
bors[bot]
363b46eca7 Merge #368
368: fix write to flush buffer; fix warnings r=MarkMcCaskey a=MarkMcCaskey

resolves #363 

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-04-20 00:22:07 +00:00
Mark McCaskey
9256f6e60a update changelog 2019-04-19 16:48:30 -07:00
Mark McCaskey
8095d70957 fix write to flush buffer; fix warnings 2019-04-19 15:57:51 -07:00
bors[bot]
f7e4a09832 Merge #343
343: add preopened fd and fix/improve fs syscalls; fix wasi memory access r=MarkMcCaskey a=MarkMcCaskey

resolves #356 

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-04-19 21:24:58 +00:00
Mark McCaskey
5a575cd64d
Merge branch 'master' into feature/preopen-fd-and-more 2019-04-19 14:24:30 -07:00
Syrus Akbary
b4ded07313
Merge branch 'master' into feature/preopen-fd-and-more 2019-04-19 14:14:40 -07:00
bors[bot]
f959c3f15a Merge #367
367: Add caching support to llvm backend r=lachlansneff a=lachlansneff

This changes the `CacheGen` trait a little, since it was weird.

Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>
2019-04-19 21:10:14 +00:00
Lachlan Sneff
087a826222 fix tests on more time uh huh 2019-04-19 14:09:41 -07:00