4557 Commits

Author SHA1 Message Date
Syrus
a1d8b9aa5b Move backend_id to static str 2020-01-13 15:40:09 +01:00
Syrus Akbary
cb5cf00442
Update CHANGELOG.md 2020-01-13 15:14:56 +01:00
bors[bot]
b27c35326c
Merge #1099
1099: Remove backend::Backend from runtime-core 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

This PR removes the dependency of a Backend in runtime-core. So it's agnostic and more backends can be plugged in easily.

Why this is important?
* By removing backends from wasmer-runtime-core we can make the runtime agnostic, so anyone can plug their own backend into Wasmer without needing to touch the main source code (V8, JavascriptCore, wasm3, ...).
* It simplifies the codebase and avoids code leaks from the backend to the runtime API.

<!-- 
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>
Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-01-13 11:05:20 +00:00
Syrus
3892ea827d Fixed lint 2020-01-13 12:04:39 +01:00
Syrus
846c632b50 Fixed runtime check 2020-01-13 10:17:37 +01:00
Syrus
4faa78b38c Fixed changelog link 2020-01-13 10:17:37 +01:00
Syrus
aa6189a06a Make all tests pass 2020-01-13 10:17:37 +01:00
dependabot-preview[bot]
22e35fc670 Bump cc from 1.0.48 to 1.0.50
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.48 to 1.0.50.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.48...1.0.50)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 10:17:37 +01:00
dependabot-preview[bot]
f18a4280a6 Bump regex from 1.3.1 to 1.3.3
Bumps [regex](https://github.com/rust-lang/regex) from 1.3.1 to 1.3.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.3.1...1.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 10:17:36 +01:00
dependabot-preview[bot]
00618e852e Bump parking_lot from 0.9.0 to 0.10.0
Bumps [parking_lot](https://github.com/Amanieu/parking_lot) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/Amanieu/parking_lot/releases)
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/0.9.0...0.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 10:17:36 +01:00
dependabot-preview[bot]
8fd143368d Bump getrandom from 0.1.13 to 0.1.14
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.1.13 to 0.1.14.
- [Release notes](https://github.com/rust-random/getrandom/releases)
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/getrandom/compare/v0.1.13...v0.1.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 10:17:36 +01:00
Mark McCaskey
5b52589021 Update the experimental io device path to include /dev/ 2020-01-13 10:17:36 +01:00
Mark McCaskey
cc28804efe Update the name of experimental IO devices in fs 2020-01-13 10:17:36 +01:00
Syrus Akbary
da0d8b39c5
Merge pull request #1139 from wasmerio/dependabot/cargo/cc-1.0.50
Bump cc from 1.0.48 to 1.0.50
2020-01-13 10:10:51 +01:00
Syrus Akbary
0eb6ea0800
Merge pull request #1138 from wasmerio/dependabot/cargo/regex-1.3.3
Bump regex from 1.3.1 to 1.3.3
2020-01-13 10:10:38 +01:00
Syrus Akbary
10d9650d5f
Merge pull request #1136 from wasmerio/dependabot/cargo/parking_lot-0.10.0
Bump parking_lot from 0.9.0 to 0.10.0
2020-01-13 10:10:24 +01:00
Syrus Akbary
82a9881ccb
Merge pull request #1135 from wasmerio/dependabot/cargo/getrandom-0.1.14
Bump getrandom from 0.1.13 to 0.1.14
2020-01-13 10:10:12 +01:00
dependabot-preview[bot]
cbd5ed1916
Bump cc from 1.0.48 to 1.0.50
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.48 to 1.0.50.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.48...1.0.50)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 07:59:14 +00:00
dependabot-preview[bot]
25f75a0f98
Bump regex from 1.3.1 to 1.3.3
Bumps [regex](https://github.com/rust-lang/regex) from 1.3.1 to 1.3.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.3.1...1.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 07:58:45 +00:00
dependabot-preview[bot]
5364b2c308
Bump parking_lot from 0.9.0 to 0.10.0
Bumps [parking_lot](https://github.com/Amanieu/parking_lot) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/Amanieu/parking_lot/releases)
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/0.9.0...0.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 07:57:23 +00:00
dependabot-preview[bot]
1556e3090c
Bump getrandom from 0.1.13 to 0.1.14
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.1.13 to 0.1.14.
- [Release notes](https://github.com/rust-random/getrandom/releases)
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/getrandom/compare/v0.1.13...v0.1.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 07:56:50 +00:00
bors[bot]
95cc18ae8f
Merge #1134
1134: Update the name of experimental IO devices in fs r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-11 01:11:42 +00:00
Mark McCaskey
2fb9415e32 Update the experimental io device path to include /dev/ 2020-01-10 17:10:46 -08:00
Mark McCaskey
600f4ded9e Update the name of experimental IO devices in fs 2020-01-10 17:00:26 -08:00
Syrus Akbary
9ca97706d7
Merge branch 'master' into backend-refactor 2020-01-10 13:41:49 +01:00
Syrus
f353ac00eb Remove unused backend flags 2020-01-10 13:40:21 +01:00
bors[bot]
50f3079d82
Merge #1121
1121: Add test for ImportObject's `allow_missing_functions` r=Hywan a=MarkMcCaskey

work in progress, testing to see if this test fails CI

resolves #1118 

# 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: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-01-10 10:16:32 +00:00
Ivan Enderlin
66574e3e27
Merge branch 'master' into fix/import-object-allow-missing 2020-01-10 11:16:09 +01:00
bors[bot]
be29b2e007
Merge #1128
1128: fix(runtime-core) Avoid crashing when missing host functions are allowed r=Hywan a=Hywan

Fix #1118. #1121 can be merged after

This PR fixes 2 things:

* When droping the import backing, check that `vm::FuncCtx` isn't null before dropping it,
* Use an `always_trap` as a placeholder host function when a host function is missing.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-01-10 09:23:58 +00:00
Ivan Enderlin
43742cf980 doc(changelog) Add #1128. 2020-01-10 10:18:51 +01:00
Ivan Enderlin
9b2f0fc635 chore(runtime-core) Avoid code duplication. 2020-01-10 10:15:26 +01:00
bors[bot]
57b6ad0600
Merge #1126
1126: Set default scale on fb window to fit screen r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-09 22:15:02 +00:00
bors[bot]
fab3b787eb
Merge #1130
1130: Add WindowClosed event to experimental fb r=MarkMcCaskey a=MarkMcCaskey

Allows things to behave properly and know when the window closes

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-09 20:25:36 +00:00
Mark McCaskey
b08b65913b Add WindowClosed event to experimental fb 2020-01-09 12:11:34 -05:00
Ivan Enderlin
c81e49a091 feat(runtime-core) Replace missing host function by always_trap. 2020-01-09 15:12:09 +01:00
Ivan Enderlin
6018aa32e1 fix(runtime-core) Drop vm::FuncCtx if not null. 2020-01-09 15:11:51 +01:00
Ivan Enderlin
19c3837881 feat(runtime-core) Create the always_trap host function. 2020-01-09 15:10:53 +01:00
Ivan Enderlin
cd6e4bdaee test(runtime) Fix CS. 2020-01-09 15:10:23 +01:00
bors[bot]
6370fd7b81
Merge #1123
1123: feat(runtime-c-api) Define the `DEPRECATED` C macro. r=Hywan a=Hywan

This PR defines a cross-compiler `DEPRECATED(message)` macro. It must
be used as follows in Rust:

```rust
/// This is a documentation.
/// cbindgen:prefix=DEPRECATED("This is a deprecation message.")
pub extern "C" fn wasmer_foo() -> c_uint {
    42
}
```

It will generate the following C header:

```c
/**
 * This is a documentation.
 */
DEPRECATED("This is a deprecation message.")
unsigned int wasmer_foo();
```

And once this code is used by a C compiler, it will print something
like this (example from Clang):

```
…/test.c:…:…: error: 'wasmer_foo' is deprecated: This is a deprecation message. [-Werror,-Wdeprecated-declarations]
    unsigned int x = wasmer_foo();
                     ^
…/wasmer.h:…:…: note: 'wasmer_foo' has been explicitly marked deprecated here
DEPRECATED("This is a deprecation message.")
^
…/wasmer.h:…:…: note: expanded from macro 'DEPRECATED'
```

This is required for further deprecations.

(cf https://github.com/eqrion/cbindgen/issues/408)

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-01-09 13:11:52 +00:00
Ivan Enderlin
49401b7a9d
Merge branch 'master' into feat-runtime-c-api-deprecated 2020-01-09 14:11:30 +01:00
Mark McCaskey
f48a74e44a Set default scale on fb window to fit screen 2020-01-09 06:48:03 -05:00
Ivan Enderlin
7b6d8993e1 chore(runtime-c-api) Update C/C++ headers. 2020-01-09 10:17:34 +01:00
Ivan Enderlin
038fbc287d Merge branch 'feat-runtime-c-api-deprecated' of github.com:Hywan/wasmer into feat-runtime-c-api-deprecated 2020-01-09 10:16:41 +01:00
Ivan Enderlin
67b684ac85 feat(runtime-c-api) Improve DEPRECATED compatibility.
Clang can emulate GNUC or MSVC behaviors. So instead of detecting
whether Clang is used to compile the code, it's better to detect the
targeted features are available.

Code proposed by @nlewycky, thanks!
2020-01-09 10:13:22 +01:00
bors[bot]
8e6015f231
Merge #1124
1124: Update wapm submodule to 0.4.2 r=MarkMcCaskey a=MarkMcCaskey

Uses the updated wapm from the new release https://github.com/wasmerio/wapm-cli/releases/tag/0.4.2 which fixes a bug

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-08 18:42:01 +00:00
Mark McCaskey
34bf886883 Update wapm submodule to 0.4.2 2020-01-08 13:37:29 -05:00
Ivan Enderlin
c23eca25c0
Merge branch 'master' into feat-runtime-c-api-deprecated 2020-01-08 15:50:50 +01:00
Ivan Enderlin
4f691dde17 chore(runtime-c-api) Update headers. 2020-01-08 15:25:48 +01:00
Ivan Enderlin
b31a3dcdec feat(runtime-c-api) Define the DEPRECATED macro.
This PR defines a cross-compiler `DEPRECATED(message)` macro. It must
be used as follows in Rust:

```rust
/// This is a documentation.
/// cbindgen:prefix=DEPRECATED(This is a deprecation message.")
pub extern "C" fn wasmer_foo() -> c_uint {
    42
}
```

It will generate the following C header:

```c
/**
 * This is a documentation.
 */
DEPRECATED("This is a deprecation message.")
unsigned int wasmer_foo();
```

And once this code is used by a C compiler, it will print something
like this (example from Clang):

```
…/test.c:…:…: error: 'wasmer_foo' is deprecated: This is a deprecation message. [-Werror,-Wdeprecated-declarations]
    unsigned int x = wasmer_foo();
                     ^
…/wasmer.h:…:…: note: 'wasmer_foo' has been explicitly marked deprecated here
DEPRECATED("This is a deprecation message.")
^
…/wasmer.h:…:…: note: expanded from macro 'DEPRECATED'
```

This is required for further deprecations.
2020-01-08 15:02:57 +01:00
Mark McCaskey
078242b55b Add test for ImportObject's allow_missing_functions 2020-01-07 12:04:50 -05:00