2516 Commits

Author SHA1 Message Date
bors[bot]
4099cc1984
Merge #1142
1142: doc(runtime-c-api) Setup Doxygen r=syrusakbary a=Hywan

With @MarkMcCaskey, we discussed generating the documentation of `wasmer-runtime-c-api` with [Doxygen](http://www.doxygen.nl/).

This patch does the following:

1. Set up a `doxyfile`, which is the configuration file for Doxygen.
2. Set up a `doc/header.html` and `doc/footer.html` files, because Doxygen HTML output is… well, not a master piece 😉.
3. Set up a `doc/css/wasmer.css` stylesheet. I tried to mimic Wasmer color scheme. Usually, I'm not a bad designer, but Doxygen HTML output is so “alembic-ed” that it makes customizing the CSS a real challenge for the very short period of time I've.

Anyway, I believe it's an acceptable first step.

To generate the documentation:

```sh
$ doxygen doxyfile
```

And then open `doc/html/index.html`.

It looks like this:

![Screen Shot 2020-01-13 at 15 20 09](https://user-images.githubusercontent.com/946104/72263046-692ea100-3618-11ea-9feb-6dfd3244d375.png)
![Screen Shot 2020-01-13 at 15 20 25](https://user-images.githubusercontent.com/946104/72263072-70ee4580-3618-11ea-941d-fa652bd7f14e.png)
![Screen Shot 2020-01-13 at 15 20 35](https://user-images.githubusercontent.com/946104/72263082-7481cc80-3618-11ea-81e7-f4da7b71d665.png)
![Screen Shot 2020-01-13 at 15 20 57](https://user-images.githubusercontent.com/946104/72263098-78155380-3618-11ea-9cfc-16b7695c9e89.png)

The next step is to publish the documentation on Github Pages, thoughts @syrusakbary?

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-01-14 08:08:06 +00:00
Mark McCaskey
3fd1408cbc Update io device file name 2020-01-13 17:56:46 -08:00
Ivan Enderlin
6dbfa9d4a2 fix(runtime-c-api) Remove duplicated line.
A copy-paste error has been spotted!
2020-01-13 17:11:12 +01:00
Ivan Enderlin
7df0bbcc1e doc(runtime-c-api) Setup Doxygen. 2020-01-13 15:14:30 +01: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
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
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
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
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
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
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
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
Syrus
d544f5a80f Run formatting 2020-01-07 16:14:58 +01:00
Syrus
59945a8875 Use detault 2020-01-07 16:13:33 +01:00
Syrus
3b9cdc396d Recovered deleted tests 2020-01-07 16:13:33 +01:00
Syrus
8cff1adf5c Fix wasmer binary 2020-01-07 16:12:39 +01:00
Syrus
d36d883528 Fix lint 2020-01-07 16:12:39 +01:00
Syrus
e57677b63f Make cranelift optional for middleware 2020-01-07 16:12:39 +01:00
Syrus
ac0c5c93ce Fixed lint 2020-01-07 16:12:39 +01:00
Syrus
71be5bea16 Improved syntax 2020-01-07 16:12:39 +01:00
Syrus
18421e3623 Make all tests pass 2020-01-07 16:12:39 +01:00
Syrus
d7154fe791 Remove Backend dependency 2020-01-07 16:12:39 +01:00
Syrus
d4e964519d Move requires pre validation into the ModuleCodeGenerator 2020-01-07 16:10:46 +01:00
Syrus
303d44cb0f Remove backend code 2020-01-07 16:10:46 +01:00
Ivan Enderlin
0274668675 doc(runtime-c-api) Fix a typo. 2020-01-07 14:21:50 +01:00
Johan Andersson
81f879565d Add MIT license to crates that were missing it
Ran into a few crates in this repo with our license scanner that didn't have any license attached to them.

Added MIT to be consistent with the other crates. Please adjust if not correct.
2019-12-22 12:28:33 +01:00
Nick Lewycky
1cffb90fea Fix unused import warning, deny more warnings. 2019-12-21 14:35:43 -08:00
Syrus
ad82beffb4 Fixed tests 2019-12-20 21:11:55 -08:00
Syrus
a7764a6fd6 Simplified code 2019-12-20 20:49:32 -08:00
Syrus
1a960a01ae Improved lint 2019-12-20 20:45:10 -08:00
Syrus
c4d70a6b75 Use Arc instead of Rc 2019-12-20 20:37:47 -08:00
Syrus
097353d0d4 Fix lint 2019-12-20 19:20:32 -08:00
Syrus
0f45bd4f0d Fixed tiering docs 2019-12-20 19:12:35 -08:00
Syrus
c143bc8fc8 Revert emscripten changes 2019-12-20 19:09:07 -08:00
Syrus
2404203ae4 Improved based on feedback 2019-12-20 19:03:49 -08:00
Syrus
527d7072b3 Remove unsafe transmute copy 2019-12-20 18:52:30 -08:00