Commit Graph

48 Commits

Author SHA1 Message Date
Syrus
2d2b9069c7 Fix comments 2020-11-18 11:05:18 -08:00
Syrus
afbaf129b8 Added deprecated flag to the wasm c api crate 2020-11-18 09:59:12 -08:00
Ivan Enderlin
2e52e1139b chore(c-api) Update wasmer_wasm.h. 2020-11-16 15:19:17 +01:00
Ivan Enderlin
1d208af530 test(c-api) Create a tests/wasmer_wasm.h file.
Remove the `build.rs` hack to add helper functions that are used only
in our tests. Now the tests can use the `tests/wasmer_wasm.h` file,
which simplifies the test workflow: No need to hack the build script
or anything if we want to add a helper function.
2020-11-03 10:41:00 +01:00
Ivan Enderlin
059dfceb60 chore(c-api) Update the header files. 2020-11-02 17:46:36 +01:00
bors[bot]
591691bc17 Merge #1765
1765: doc(c-api) Update documentation. r=Hywan a=Hywan

# Description

This patch adds documentation to the  `engine.rs` module.

# Review

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


Co-authored-by: Ivan Enderlin <ivan@mnt.io>
2020-10-30 10:05:52 +00:00
Mark McCaskey
adc40aeae3 Merge branch 'master' into feature/add-table-example 2020-10-27 11:57:08 -07:00
Ivan Enderlin
ce525e7e90 doc(c-api) Update documentation. 2020-10-27 13:53:47 +01:00
Nick Lewycky
1b3254cf6a Move the generated-by comment up to the first comment. 2020-10-23 11:16:30 -07:00
Nick Lewycky
8ab49df7ab Ahem. 2020-10-23 11:15:31 -07:00
Nick Lewycky
9085480ad0 Update the generated file too, of course. 2020-10-23 11:14:06 -07:00
Mark McCaskey
729a044c75 Add misc updates from feedback 2020-10-21 16:34:27 -07:00
Mark McCaskey
6d326233f7 Merge branch 'master' into fix/create-exe-genearted-code-bugs 2020-10-19 10:03:05 -07:00
Mark McCaskey
1ee99d394c Address feedback and fix small issue with cfg logic 2020-10-16 17:38:59 -07:00
Ivan Enderlin
d7d40e542f Merge branch 'master' into feat-c-api-update-wasm-h 2020-10-16 10:18:46 +02:00
bors[bot]
c5d5ac7bfe Merge #1693
1693: Add `wasmer create-exe` r=MarkMcCaskey a=MarkMcCaskey

This adds the `wasmer create-exe` subcommand.  This subcommand is a combination of `wasmer compile --object-file` and linking that compiled Wasm with a main function and libwasmer.  Put more plainly: it lets us transform Wasm modules into native executables in one step.

In order for this to work we need:
- [x] Ship wasm.h with Wasmer or use different mechanism to find it
- [x] Ship wasmer_wasm.h with Wasmer
- [x] Requires up to date libwasmer... had to build one and copy it over, may fail in CI because of this... will be fixed with next release though
- [x] More gracefully handle wasmer installed without WASMER_DIR, etc (even if just error messages, should be tested)
- [x] Add tests

# 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-10-13 21:46:16 +00:00
Ivan Enderlin
f866ea39fd fixup 2020-10-12 18:02:45 +02:00
Ivan Enderlin
b9f98ce1f6 feat(c-api) Update .h files. 2020-10-12 17:54:21 +02:00
Ivan Enderlin
437426d8b1 feat(c-api) Update wasmer_wasm.h. 2020-10-12 13:34:55 +02:00
Mark McCaskey
ba7b24f696 Add --dir and --mapdir support to native executable 2020-10-09 17:38:14 -07:00
Mark McCaskey
02c0df5101 Update to cbindgen 0.15.0
Manually specify that items should be sorted by name in the header
file. We do this because cbindgen 0.15.0 removed sorting by default.
2020-10-08 14:42:00 -07:00
Mark McCaskey
65265dbd73 Add first draft of wasmer create-exe 2020-10-08 14:13:54 -07:00
Mark McCaskey
ea8bb1ee79 Merge branch 'master' into feature/engine-object-file 2020-10-06 17:50:55 -07:00
Mark McCaskey
aa2e8f7b4d Address more feedback, clean up code 2020-10-06 12:13:59 -07: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
Mark McCaskey
1572ae1d5c Merge branch 'master' into feature/engine-object-file 2020-10-02 17:31:06 -07: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
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
Ivan Enderlin
8969756416 chore(c-api) Regenerate header files. 2020-09-29 16:08:54 +02:00
Ivan Enderlin
4165e389dc feat(c-api) Use cbindgen@master.
Our PR to support `ManuallyDrop`, `MaybeUninit` and `Box` has been
merged, https://github.com/eqrion/cbindgen/pull/578.
2020-09-29 14:16:09 +02:00
Mark McCaskey
bdbbe7ed2f Add config support to wasm-c-api 2020-09-28 15:06:00 -07:00
Ivan Enderlin
f61a11526c chore(c-api) Use original cbindgen instead of our fork. 2020-09-28 15:33:42 +02:00
Ivan Enderlin
04ef295a1d chore(c-api) Regenerate wasmer_wasm.h. 2020-09-28 14:52:55 +02:00
Ivan Enderlin
174b03f4e9 feat(c-api) Use our fork of cbindgen.
Our fork contains incoming PR. It helps for example to skip struct
fields.
2020-09-24 16:15:04 +02:00
Ivan Enderlin
3514988462 feat(c-api) Generate wasmer_wasm.h automatically. First draft. 2020-09-22 16:54:22 +02:00
Mark McCaskey
8a9ac6ce59 Add helper function to get the start function 2020-08-12 18:03:57 -07:00
Mark McCaskey
cba35df3f1 Use wasi_env_set_instance instead of wasi_env_set_memory 2020-08-12 17:32:28 -07:00
Mark McCaskey
892fb4efcf Make caller responsible for allocation array for getting WASI imports 2020-08-12 17:08:58 -07:00
Mark McCaskey
2e36c8e63b Clean up and simplify API: explicit version no longer required 2020-08-12 13:09:58 -07:00
Mark McCaskey
5915cd9d3f Use circular buffer for stdout capture to reduce memory usage 2020-08-12 09:40:44 -07:00
Mark McCaskey
747cdd424a Try replacing wasi_state_builder_t with wasi_config_t
Experimenting to simplify our API.
2020-08-12 09:23:56 -07:00
Mark McCaskey
f4a2b46ace More small changes from feedback 2020-08-11 16:49:51 -07:00
Mark McCaskey
c52678aba4 Clean up from feedback 2020-08-11 16:31:02 -07:00
Mark McCaskey
3919e435c4 Clean up WASI 'Wasm C API' API 2020-08-11 13:08:33 -07:00