5169 Commits

Author SHA1 Message Date
Ivan Enderlin
cc93f3197b
Merge branch 'master' into feat-interface-types-encoders-binary 2020-02-18 09:57:29 +01:00
bors[bot]
8c17455456
Merge #1229
1229: Add clippy::missing_safety_doc lint to wasi, misc clean up r=MarkMcCaskey a=MarkMcCaskey

Part of #1219 

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-02-18 00:32:44 +00:00
Syrus Akbary
5bf6be445a
Delete index.html 2020-02-17 16:09:37 -08:00
Mark McCaskey
c005f94a55 Add clippy::missing_safety_doc lint to wasi, misc clean up 2020-02-17 15:15:04 -08:00
bors[bot]
bcb1f0421c
Merge #1226
1226: chore(runtime-core) Some code clean ups r=syrusakbary a=Hywan

Extracted from #1018. Opinionated patch.

Some code clean ups, mostly renaming `ExternalFunction` to `HostFunction`.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-02-17 21:00:54 +00:00
Syrus Akbary
abd44e9fba
Merge branch 'master' into feat-runtime-core-cleanup-typed-func 2020-02-17 13:00:13 -08:00
bors[bot]
7cf383032f
Merge #1222
1222: feat(runtime-core) Simplify `WasmExternType` implementations with macros r=Hywan a=Hywan

Extracted from #1018.

This PR simplifies the code (understand, remove code duplication) of `WasmExternType` by using a macro.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-02-17 19:57:47 +00:00
Ivan Enderlin
8d31f0b7e9
Merge branch 'master' into feat-runtime-core-wasm-extern-type-macros 2020-02-17 20:57:27 +01:00
bors[bot]
adc651def6
Merge #1224
1224: fix(runtime-core) Remove warnings r=Hywan a=Hywan

Because we can use the `impl_traits!` macro with only one identifier,
a warning is emitted saying the parenthesis are useless for this
specific usecase. They are required for all the other usecases
though. We can safely ignore this warning.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-02-17 19:34:57 +00:00
Ivan Enderlin
7f0e220f70
Merge branch 'master' into fix-runtime-core-warnings 2020-02-17 20:34:05 +01:00
Ivan Enderlin
8d8a5f6d5a
Merge branch 'master' into feat-runtime-core-cleanup-typed-func 2020-02-17 20:33:35 +01:00
bors[bot]
1158951d5c
Merge #1221
1221: doc(interface-types) Add a `README.md` file r=MarkMcCaskey a=Hywan

Just a small `README.md`, so that users aren't totally loss.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-02-17 19:15:58 +00:00
bors[bot]
5832b48159
Merge #1228
1228: Singlepass cleanup: Resolve several FIXMEs and remove protect_unix. r=losfair a=losfair



Co-authored-by: losfair <zhy20000919@hotmail.com>
2020-02-17 18:57:30 +00:00
losfair
b1e2a7fb4d Update changelog. 2020-02-18 02:38:33 +08:00
losfair
ed826cb389 Cleanup various FIXMEs and remove protect_unix. 2020-02-18 02:35:19 +08:00
Ivan Enderlin
9013d52ea4 doc(runtime-core) Hide some traits and structs in the documentation.
Those are not necessary for the user. It's only internal
implementation, that must be public because it ends up in public
types, but the compiler infers everything automatically.
2020-02-17 16:03:54 +01:00
Ivan Enderlin
ad77803243 fix(runtime-core) Rename ExternalFunction to HostFunction. 2020-02-17 16:02:23 +01:00
Ivan Enderlin
533609ff70 chore(runtime-core) Move one statement to be closer to the definition. 2020-02-17 16:01:01 +01:00
Ivan Enderlin
2ee1e80f3b feat(runtime-core) Allow dynamic signature for polymorphic host functions.
This patch adds a new field in `Func`: `signature`. It contains the
signature of the host function.

For non-polymorphic host functions, the signature is computed from the
`Args` and `Rets` implementation parameters at compile-time.

For polymorphic host functions though, to be fully dynamic, the
signature given to `new_polymorphic` is used in `Func` as the correct
signature.
2020-02-17 15:50:12 +01:00
Ivan Enderlin
ad20a008e0 fix(runtime-core) Use explicit dyn for trait objects. 2020-02-17 15:30:25 +01:00
Ivan Enderlin
ff154999f3 fix(runtime-core) Remove warnings.
Because we can use the `impl_traits!` macro with only one identifier,
a warning is emitted saying the parenthesis are useless for this
specific usecase. They are required for all the other usecases
though. We can safely ignore this warning.
2020-02-17 15:20:21 +01:00
Ivan Enderlin
1d1ffcc10a feat(runtime-core) Implement TryFrom<native_type> for Value. 2020-02-17 14:56:43 +01:00
Ivan Enderlin
9088f6b9e2 feat(runtime-core) Simplify WasmExternType implementations with macros. 2020-02-17 14:53:09 +01:00
Ivan Enderlin
d6cd1fa6c4 doc(interface-types) Add a README.md file. 2020-02-17 14:48:58 +01:00
Ivan Enderlin
ff2ff0691b doc(changelog) Add #1216. 2020-02-17 14:12:55 +01:00
Ivan Enderlin
306d19274b test(interface-types) Test roundtrip: AST to binary to AST. 2020-02-17 13:55:59 +01:00
Ivan Enderlin
8736f0548e test(interface-types) Fix one bug and write the test suite. 2020-02-17 13:55:59 +01:00
Ivan Enderlin
1149158589 feat(interface-types) Add the binary encoder. 2020-02-17 13:55:59 +01:00
Syrus Akbary
a21cf6d4c3
Added link to a custom ABI example repo
https://github.com/wasmerio/wasmer-rust-customabi-example
2020-02-16 12:48:20 -08:00
losfair
7b0f7ee55e Merge remote-tracking branch 'origin/master' into feature/polymorphic-v2 2020-02-16 00:39:27 +08:00
losfair
5f4561e5ef Fix compilation error on Aarch64. 2020-02-16 00:28:43 +08:00
Mark McCaskey
923e4ac83a Add command line flag, make debug crate optional, clean up API 2020-02-14 12:34:25 -08:00
bors[bot]
32991e676e
Merge #1218
1218: Enable clif verifier in debug mode, fix issue with verifier r=MarkMcCaskey a=MarkMcCaskey

Ensures we're using I32s to index into things that are indexed by I32s

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-02-14 19:47:20 +00:00
Mark McCaskey
23275d07f6 Improve clif verifier error message 2020-02-14 11:45:11 -08:00
Mark McCaskey
5e3147db08 Enable clif verifier in debug mode, fix issue with verifier 2020-02-14 11:32:49 -08:00
losfair
12373bb872 Func::new_polymorphic 2020-02-15 01:31:49 +08:00
losfair
2fe6e6f039 Global trampoline buffer. 2020-02-15 01:31:33 +08:00
Syrus Akbary
8faac62bc0
Merge pull request #1215 from Hywan/fix-interface-types-dbg
fix(interface-types) Remove a `dbg!` macro
2020-02-14 08:37:49 -08:00
Ivan Enderlin
0c4c9107d5 fix(interface-types) Remove a dbg! macro. 2020-02-14 12:19:29 +01:00
Syrus Akbary
07c8eff47f
Use wapm packages last after $PATH 2020-02-14 00:16:32 -08:00
bors[bot]
f4829c7fe5
Merge #1209
1209: Maybe improve safety of MemoryView Deref r=MarkMcCaskey a=MarkMcCaskey

Possibly slightly better... (effectively does exactly the same thing the same way):

Notably this code still violates the safety rules of its unsafe functions:

It violates rule 2 from https://doc.rust-lang.org/std/slice/fn.from_raw_parts_mut.html :

> The memory referenced by the returned slice must not be accessed through any other pointer (not derived from the return value) for the duration of lifetime ’a. Both read and write accesses are forbidden.


Some comments in the stdlib indicate that casting between `Cell<T>` and `T` isn't something that's safe to do outside of the stdlib 🤷‍♂ .

Fundamentally, `MemoryView` is unsound.  Our docs say that it does not have undefined behavior, but we don't properly justify that.   I believe it relies very heavily on undefined behavior.

Looking for feedback here about what we can do.  It seems like we'll have to break the public API to make a sound API... if we can decide on a sufficiently good one, we can deprecate the old one and roll out the new one to prevent user breakage.

We may need to use something like https://docs.rs/crossbeam/0.7.3/crossbeam/atomic/struct.AtomicCell.html or implement something like it.

Where I'm at in regards to memory access from the host is that it's not possible to make any kind of efficient API that is not entirely `unsafe`.  Even given that, we need to figure out the bounds with which the `unsafe` functions can be used relatively safely.  I think even if we marked our existing functions as `unsafe`, it's too complex to figure out whether or not you're using it correctly...

Bonus points if your solution works across multiple threads properly...

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-02-14 00:13:48 +00:00
Mark McCaskey
c8e3a0925b
Merge branch 'master' into feature/changed-memory-view 2020-02-13 16:04:43 -08:00
bors[bot]
7dbe357e89
Merge #1214
1214: test(interface-types) Add `wasmer-interface-types` to `make check` r=MarkMcCaskey a=Hywan

Sequel of #787. Forgot to update the changelog, and to add `wasmer-interface-types` to `make check`.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-02-13 19:02:21 +00:00
Mark McCaskey
344bf0716c
Merge branch 'master' into test-interface-types 2020-02-13 11:01:57 -08:00
bors[bot]
1d3ae6a00e
Merge #1213
1213: Fixed WASI isatty r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

Current WASI implementation returns a wrong response when libc `isatty` is used for `stdin`, `stdout` or `stderr`.

This PR fixes it.

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-02-13 18:42:30 +00:00
Syrus Akbary
7a45bd8a39
Merge branch 'master' into fix/isatty 2020-02-13 10:42:09 -08:00
Syrus
60e686ff76 Added change into changelog 2020-02-13 10:37:27 -08:00
Syrus
61c85b3fbf Improved fd_write debugging 2020-02-13 10:35:48 -08:00
Syrus
c287170166 Fixed wasi isatty tests when being generated 2020-02-13 10:33:27 -08:00
Ivan Enderlin
07ba2c82b9 test(interface-types) Add wasmer-interface-types to make check. 2020-02-13 15:38:35 +01:00