Commit Graph

1044 Commits

Author SHA1 Message Date
Mark McCaskey
f7d5a11b39 Fix sentinel value in wasm_limits_t for memory in wasm_c_api 2020-10-07 16:38:23 -07:00
Mark McCaskey
ea8bb1ee79 Merge branch 'master' into feature/engine-object-file 2020-10-06 17:50:55 -07:00
Mark McCaskey
e6bc138b10 Remove ability to use object file engine with compiler from C API
Due to the way object file engine works, it only makes sense to use in
headless mode from the C API.
2020-10-06 17:39:51 -07:00
Ivan Enderlin
fdb077236a feat(c-api) Implement wasm_exporttype_delete. 2020-10-06 22:22:00 +02:00
Mark McCaskey
aa2e8f7b4d Address more feedback, clean up code 2020-10-06 12:13:59 -07:00
Ivan Enderlin
c3efc06e87 test(c-api) Add test case for wat2wasm. 2020-10-06 20:56:36 +02:00
Ivan Enderlin
264ed836ac feat(c-api) Use c_try! and From implementations to simplify wat2wasm. 2020-10-06 20:56:21 +02:00
Ivan Enderlin
78887c378e chore(c-api) Simplify code. 2020-10-06 11:14:46 +02:00
Ivan Enderlin
ded3132b44 feat(c-api) Implement wat2wasm. 2020-10-06 11:09:35 +02:00
Mark McCaskey
ab153fc642 Improve error messages around memory creation 2020-10-05 15:45:52 -07:00
Mark McCaskey
0f8d68652f Finish merge with C API refactor 2020-10-05 12:30:58 -07:00
Ivan Enderlin
3edcc89698 feat(c-api) Redefine wasm_store_t.
`wasm_store_t` is now a proper struct (rather than an opaque type) of
kind:

```rs
struct wasm_store_t {
    inner: Store
}
```

The rest of the patch updates the code accordingly.
2020-10-05 21:16:43 +02:00
Ivan Enderlin
ff4cb6d412 feat(c-api) Implement wasm_module_validate. 2020-10-05 14:49:23 +02:00
Mark McCaskey
f0487763bf Readd functionality from object file engine 2020-10-02 17:31:18 -07:00
Mark McCaskey
1572ae1d5c Merge branch 'master' into feature/engine-object-file 2020-10-02 17:31:06 -07:00
bors[bot]
1de0606b4e Merge #1673
1673: Add conversion logic for boxed_vec, simplify vec creation code r=MarkMcCaskey a=MarkMcCaskey

Fixes the issue mentioned in https://github.com/wasmerio/wasmer/issues/1631#issuecomment-702350852 



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-10-03 00:01:51 +00:00
Mark McCaskey
e6c61c74ff Update boxed_vec to deal with boxed values 2020-10-02 16:33:03 -07:00
Mark McCaskey
34e6139570 Add conversion logic for boxed_vec, simplify vec creation code 2020-10-02 16:24:46 -07:00
Mark McCaskey
3845e5fd67 Clean up binary files from C API refactor 2020-10-02 15:30:13 -07:00
Ivan Enderlin
92ca7899f5 chore(c-api) Use canonical path to wasm*.h headers. 2020-10-02 11:15:37 +02:00
Ivan Enderlin
e7d6af01e6 feat(c-api) Remove the deprecated feature.
This feature is no longer necessary. The `build.rs` no longer uses
it. The overhead of including the deprecated symbol inside the dylib
is acceptable. It simplifies the overall build system.
2020-10-02 11:09:20 +02:00
Ivan Enderlin
7f4862117f doc(c-api) Write a quick introduction to the crate. 2020-10-02 10:40:26 +02:00
Ivan Enderlin
2fdd9ea692 feat(c-api) Simplify the build.rs script. 2020-10-02 10:10:24 +02:00
Ivan Enderlin
ae1a50b5d7 chore(c-api) Move cbindgen:ignore from functions/types to modules.
This patch removes the amount of `cbindgen:ignore` instructions by
moving this instruction onto the parent module.
2020-10-02 09:51:48 +02:00
Ivan Enderlin
1a45756cad test(c-api) Use the REQUIRED option of find_library. 2020-10-02 09:45:34 +02:00
Ivan Enderlin
d5fa525612 test(c-api) Enable the test-early-exit test case. 2020-10-01 23:23:41 +02:00
Ivan Enderlin
ddbbd96f1c test(c-api) Run make clean before, in case of. 2020-10-01 23:23:23 +02:00
Ivan Enderlin
0095ec9538 fix(c-api) wasm_val_t is not an opaque type, let's use a C representation. 2020-10-01 23:07:43 +02:00
Ivan Enderlin
68d6292c35 test(c-api) Restore the test-wasi and disable the test-early-exit. 2020-10-01 21:40:02 +02:00
Ivan Enderlin
5d9fc86bb8 test(c-api) Enable the wasi-c-api-trap test case. 2020-10-01 21:27:18 +02:00
Ivan Enderlin
a117df1740 chore(c-api) Remove a warning about wasm_frame_t case. 2020-10-01 21:26:45 +02:00
Ivan Enderlin
3a81643ff0 chore(c-api) Update header files. 2020-10-01 21:23:06 +02:00
Ivan Enderlin
a2854ebfea fix(c-api) Adjust cbindgen metadata for header files. 2020-10-01 21:20:13 +02:00
Ivan Enderlin
ecb79e2af0 fix(c-api) Cherry-pick manually from https://github.com/wasmerio/wasmer/pull/1657. 2020-10-01 21:16:29 +02:00
Mark McCaskey
762a6acc85 Add rlib as a crate-type for wasmer-c-api
This is how `wasmer-runtime-c-api` was before and seems to fix a use
case that users relied on
2020-10-01 20:59:40 +02:00
Nick Lewycky
9a3c5cf389 Remove extern "C" from a non-pub function that returns non-FFI'able type.
Add `extern "C"` to two `#[no_mangle] pub` functions.
2020-10-01 20:58:09 +02:00
Ivan Enderlin
916f50463f doc(c-api) Restore the README.md. 2020-10-01 14:22:30 +02:00
Ivan Enderlin
bf7b50a8eb test(c-api) Restore the wasm-c-api test suite. 2020-10-01 14:13:02 +02:00
Ivan Enderlin
3f8d7f4f74 test(c-api) Update the CMake project name for the deprecated test suite. 2020-10-01 10:11:02 +02:00
Ivan Enderlin
c1fb4b2c29 test(c-api) Restore the deprecated test suite. 2020-10-01 10:07:35 +02:00
Ivan Enderlin
5ea1f1eb25 feat(c-api) Always generate _all_ C headers. Include the deprecated API per default. 2020-10-01 09:52:23 +02:00
Mark McCaskey
5ac0f89d92 Add small clean up 2020-09-30 17:10:05 -07:00
Mark McCaskey
fec7644bb8 Port integration test to Windows
Add conditional logic for Windows style object files

Explicitly require c11 for wasm.h

Use `clang++` on Windows for `static_assert`

Improve generated C + add hack to make function pointers work better

Add logic to handle Window's static library file extension

Improve linking logic to work on Windows

Add support for C++ compilers for object-file-engine generated C

Add C++ support to wasmer_wasm.h

Add C++ support to test C file too

Add linking flags for Windows, make assert line-ending neutral

Adjust asserted output to handle differences on Windows
2020-09-30 14:46:34 -07:00
Mark McCaskey
ce5f302f9a Merge branch 'master' into feature/engine-object-file 2020-09-29 17:48:38 -07:00
bors[bot]
d9246398b9 Merge #1657
1657: Add early exit example r=MarkMcCaskey a=MarkMcCaskey

Resolves #1597

This PR currently contains the example in both C and Rust

# Review

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


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-09-29 23:42:43 +00:00
Mark McCaskey
ffe1c5a9e4 Address feedback, clean up wasm_T_vec_t conversions 2020-09-29 16:41:30 -07:00
Mark McCaskey
1ed1a52d25 Get early exit example working with C API; implement wasm_trap_t API 2020-09-29 14:13:30 -07:00
Nick Lewycky
00741f02cb Remove extern "C" from a non-pub function that returns non-FFI'able type.
Add `extern "C"` to two `#[no_mangle] pub` functions.
2020-09-29 11:04:54 -07:00
Mark McCaskey
374cd36ec2 Add early exit Wasm C API example (wip) 2020-09-29 10:56:02 -07:00
Ivan Enderlin
a259ac6862 chore(c-api) Regenerate wasmer.h header files. 2020-09-29 16:21:48 +02:00