Commit Graph

751 Commits

Author SHA1 Message Date
fe9d2d8d22 Release version 2.2.1 2022-03-15 11:02:31 +00:00
4dd1634218 Release version 2.2.0 2022-02-28 17:19:14 +00:00
15f9d2646f Release version 2.2.0-rc1 2022-02-15 19:10:24 +00:00
729bb135ae Fix the "--cflags" part of "wasmer config" in README.md 2022-01-28 21:54:11 +01:00
4e27e1164c Release version 2.2.0-rc1 2022-01-27 23:59:27 +00:00
fb7a572415 Use exact version for Wasmer crate dependencies
We don't guarantee API compatibility between internal Wasmer crates when
making minor version bumps.
2022-01-19 21:35:09 +00:00
ebcea4a5c4 Release v2.1.1 2021-12-21 12:19:50 +01:00
0f96392966 Update C API development docs 2021-12-13 10:59:34 +00:00
4dfe84c4d1 Fix wasm_importtype_new's Rust signature to not assume boxed vectors
Fixes #2718
2021-12-13 00:33:55 +00:00
2ed70bdebf Make C-API and Wasi dependencies more lean 2021-12-02 12:58:19 +01:00
c650ffea33 Version 2.1.0 2021-11-30 23:46:54 +00:00
cb6aa9b1b9 Update changelog 2021-11-30 22:06:35 +00:00
af29488bf9 Undo breaking change in C API 2021-11-23 17:59:31 +00:00
e2c6a39d37 Clean up error handling in the C API 2021-11-23 16:11:26 +00:00
a603c33def Validate that CPU features are supported when instantiating a module 2021-11-23 15:21:34 +00:00
724c59c751 More bug fixes 2021-11-17 00:03:28 +00:00
75cb5ab788 Refactor the C API to eliminate memory leaks 2021-11-15 17:01:28 +00:00
cff3e18a34 Fix memory leaks in C API examples 2021-11-15 17:01:28 +00:00
88f1b19ff1 Revert "feat(c-api) Create OrderedResolver from a parallel iterator."
This reverts commit 446a76312b.
2021-11-15 17:01:28 +00:00
0a529f1513 Remove wasmer.h from git since it is auto-generated at build time 2021-10-19 16:19:39 +01:00
860b414b02 fix segment fault in c-api Example
the result from wasm_extern_as_func was not marked as "own"
`sum_func` was not owned by itself, delete it will cause a double free
2021-10-18 01:25:29 +08:00
167d9268eb Merge branch 'master' into js-api-wasi 2021-08-30 12:04:27 +02:00
f09fb3e896 Improved headless support on c-api 2021-08-21 10:21:37 +01:00
21a8ca3945 Add iOS test 2021-08-21 10:21:37 +01:00
f1878eb702 Switch back to using wasmer_api::wasmerparser dependency. 2021-08-21 10:21:37 +01:00
e038914eea Add compiler flags around wasmer_compiler_t bug 2021-08-21 10:21:37 +01:00
7798daf6c4 Remove cargo changes 2021-08-21 10:21:37 +01:00
6ddc2f6454 Add iOS support for Headless Wasmer 2021-08-21 10:21:37 +01:00
5b53c5497a fix(c-api,cli) Use the default features from wasmer-wasi.
`wasmer-wasi`'s default features don't change, except that it adds
`host_fs` in the default features, which maps to
`wasmer-vfs/host_fs`. It then ensures that the same behavior is
guaranteed.

We don't need to change how `wasmer-cli` and `wasmer-c-api` fetch
`wasmer-wasi` in this case.
2021-08-16 15:54:19 +02:00
70b70724c5 doc(changelog) Add #2521. 2021-08-16 15:18:36 +02:00
446a76312b feat(c-api) Create OrderedResolver from a parallel iterator.
This patch adds `rayon` to `wasmer-c-api` so that we can create an
`OrderedResolver` from a `ParallelIterator`. For modules with a long
list of imports, it's interesting to parallelize the work.
2021-08-16 14:38:35 +02:00
7e91448838 doc(c-api) Fix link to the documentation 2021-08-12 14:08:19 +02:00
fa1c634397 Merge branch 'master' into js-api-wasi-base 2021-07-30 10:32:39 -07:00
75142b3871 DOCS: Make wasm_limits_t members publicly visible.
Issue 2485
2021-07-28 12:50:15 -04:00
616d199d9f Fix compilation/linting issues 2021-07-26 20:40:27 -07:00
4200f2e79a Base support for WASI in wasmer-js
commit b6245ddd19077015a974e9ffd28f164fedb87801
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 23 23:07:45 2021 -0700

    Remove unused code

commit 6bbf28c5c6d8c4603606e21af3190c52f41cbeb8
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 23 22:50:50 2021 -0700

    Remove set_last_accessed, set_last_modified, set_created_time from the VirtualFs

commit 999d6941c93f0ea8c8c803c7b1843ec90bd178b5
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 23 22:42:23 2021 -0700

    Remove webc files

commit 197b72a8978a2364145e20ebd6d44b5bd23082db
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 23 22:38:29 2021 -0700

    Revert "Wip updates for python webc"

    This reverts commit 2d3e013e64424c0a50f32f44ad0401680d31bf9d.

    # Conflicts:
    #	Cargo.lock
    #	lib/cli/Cargo.toml
    #	lib/cli/src/commands/run.rs
    #	lib/cli/src/commands/run/wasi.rs
    #	lib/vfs/Cargo.toml
    #	lib/wasi/Cargo.toml
    #	lib/wasi/src/state/builder.rs
    #	lib/wasi/src/state/mod.rs

commit 83b7e3b1a1708ed34694e9a44902bd6d0617f0a4
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 23 22:34:36 2021 -0700

    revert Remove webc

commit 2de7f7f0ce518c74912509ef1fa4b7b1f00c4d11
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 23 22:31:05 2021 -0700

    Improved testing

commit 97075c5fa69fd2ef9192a4a9737400359e0ee37f
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 23 22:06:08 2021 -0700

    Improved bindings

commit 9388790c2d31654701dd2925d30bfb35b158727c
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 23 18:15:43 2021 -0700

    Renamed virtual-fs to vfs

commit 41d91328cd83d10c0fa7242fcfd731335bcd741e
Merge: c0634645a 51fdf66d5
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 23 18:00:49 2021 -0700

    Merge branch 'master' into js-api-wasi

commit c0634645aebdf25fb545c63368114b531934970d
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 23 15:06:08 2021 -0700

    Fixed serde dependency

commit 02def893ae24f2da279ed6d3b39b4e50c18ec708
Merge: f13e4c86d d3930be60
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 23 15:04:35 2021 -0700

    Merge branch 'js-api' into js-api-wasi

    # Conflicts:
    #	lib/wasi/Cargo.toml

commit f13e4c86d48a0a527fa72270f29c9f8b97a6f820
Merge: f4ac010e1 fe04ea894
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 16 00:01:19 2021 -0700

    Merge branch 'js-api' into js-api-wasi

commit f4ac010e1ff33cd046474a500bb5b9e4604085f6
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Thu Jul 15 22:50:09 2021 -0700

    Use latest resolver for namespace

commit 505896a47c7d658cb4e39ab5256c9e960a2fedc6
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Thu Jul 15 22:49:48 2021 -0700

    Updated WASI implementation

commit 30470cb81248a388ea5cf27f1838aeb264dc8956
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Thu Jul 15 15:51:56 2021 -0700

    Improved logging

commit caf0c8289ad8ce2471558baab17adee4abc011f5
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Thu Jul 15 13:55:43 2021 -0700

    Improved wasmer-js debugging

commit 4e2278dafe8999c262a0cea5afd23f8ae895abcb
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Thu Jul 15 08:29:35 2021 -0700

    Added wasi tests

commit 4f5c1fdbdae1f953498016c32d158038b6a6dc97
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Wed Jul 14 22:22:41 2021 -0700

    Fixed build

commit 692111d098b73229dbe722645b3d86ff6f5e4a5e
Merge: 35dade1b1 7195a9c3f
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Wed Jul 14 22:18:01 2021 -0700

    Merge branch 'js-api' into js-api-wasi

    # Conflicts:
    #	lib/js-api/src/trap.rs

commit 35dade1b16f01ce67a23ba4fbfa25224dda1403e
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Wed Jul 14 22:12:38 2021 -0700

    Fixed wasi wast

commit d3a6b42f8ebd790024c7631a87a295bd6957bb80
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Wed Jul 14 22:12:22 2021 -0700

    Added extra instruction for wasmer-js

commit 95b5c1ad005b17a3bacca45f906d717780f4f95a
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Wed Jul 14 22:12:12 2021 -0700

    Improved API to be resilient in and out js

commit e4074de27bd4adcd9ee8e9e4973c2cfd5208d523
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Wed Jul 14 18:54:14 2021 -0700

    Improved traps

commit e512e06cc8c476a74eb9a8e381b0d4019cdc4365
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Wed Jul 14 18:31:30 2021 -0700

    Improved WasiFs

commit cc7bda3ae33a01336e79e0a6ca48e2a72eb0ad98
Merge: 0721bbfe0 8047e3eb6
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Wed Jul 14 15:15:05 2021 -0700

    Merge branch 'js-api' into js-api-wasi

    # Conflicts:
    #	lib/js-api/Cargo.toml
    #	lib/js-api/src/cell.rs
    #	lib/js-api/src/env.rs
    #	lib/js-api/src/export.rs
    #	lib/js-api/src/exports.rs
    #	lib/js-api/src/externals/function.rs
    #	lib/js-api/src/externals/memory.rs
    #	lib/js-api/src/externals/table.rs
    #	lib/js-api/src/instance.rs
    #	lib/js-api/src/lib.rs
    #	lib/js-api/src/module.rs

commit 0721bbfe04d8d3b54ddcfa66a60a3cb501631ac6
Merge: 8354e03f1 3604debec
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 2 16:15:49 2021 -0700

    Merge branch 'master' into js-api-wasi

commit 8354e03f19b810f8fdaf0cadc3eb89bad30220ab
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 2 10:25:27 2021 -0700

    Improved sync

commit bfa6db7e7201b46fd992361699141df501e6d13c
Merge: 30aa8d4bb 7553efba3
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jul 2 10:07:23 2021 -0700

    Merge branch 'features-cell' into js-api-wasi

    # Conflicts:
    #	lib/api/src/ptr.rs

commit 30aa8d4bb0115b3bb8275212d2f33327d32546e6
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Thu Jul 1 17:36:47 2021 -0700

    Improved VirtualFS

commit a72dc93d345ca2c4967a75a0e3ef5243ebe86f33
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Thu Jul 1 17:36:37 2021 -0700

    Improved wasmer-js API

commit 63c13f371f19103adb74a6f394c4c09d8fcc4d52
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jun 25 17:32:33 2021 -0700

    Updated memory_fs

commit a9e7206b7437984ac367351ea75bb14c8cafaf4d
Merge: 6e7285af0 be5af68ef
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jun 25 17:14:29 2021 -0700

    Merge branch 'feature/webc' into js-api-wasi

    # Conflicts:
    #	Cargo.lock
    #	lib/cli/Cargo.toml
    #	lib/virtual-fs/Cargo.toml
    #	lib/wasi/Cargo.toml
    #	lib/wasi/src/state/mod.rs

commit 6e7285af02367a6431b302c17b708f8e0854be82
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jun 25 17:07:39 2021 -0700

    Updated virtual fs deps

commit 5eab9ac6f629ddb82f5e97c5fce37998fadf262d
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jun 25 17:07:29 2021 -0700

    Make wasi not serializable

commit 1d242d4564e898d773601b87d135a8f5dc4a0f57
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jun 25 17:05:30 2021 -0700

    Set WASI to use Strings instead of str

commit 1d7cd64232e4bdd57b64d884d4d9b38dd68e1cdb
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jun 25 17:03:23 2021 -0700

    Improve Virtual FS

commit 85f4bbe5ebc0e87138e74a43665616e96772ac5d
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jun 25 16:57:14 2021 -0700

    wasmer-js: Added functions to the mix

commit 27effe1eda37a1d810a80a489ff5c737e986f200
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jun 25 16:01:12 2021 -0700

    wasmer-js function environments working

commit be5af68efe44c5084dd140f9cc6b425f61a84f8a
Author: Mark McCaskey <mark@wasmer.io>
Date:   Fri Jun 25 15:01:18 2021 -0700

    Move webc vfs impl into wasmer src tree

commit 765c89bb3954699b86a2b820fd40857811e6c466
Author: Mark McCaskey <mark@wasmer.io>
Date:   Fri Jun 25 14:38:19 2021 -0700

    Get python.webc working

commit bedc25cbf00a91cca193bb21834117dc3344febe
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Fri Jun 25 09:17:26 2021 -0700

    wasmer-js improve get_host_environment

commit ee3a36d53b06be72dc00877332c4aaf0b2f57aa4
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Thu Jun 24 19:37:34 2021 -0700

    Added wasm32 API

commit c136c2ac6829e4ac3d916dc5687a7c999dd6c412
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Thu Jun 24 18:56:19 2021 -0700

    Improved wasmer_js API

commit f819cbbb629442f6f020985ca34b2b57bc90deca
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Thu Jun 24 18:32:29 2021 -0700

    Improved wasmer_js imports

commit 1d4ed08d90808922ee5e74e92f162509ba8c2efb
Merge: 5451d7113 2d3e013e6
Author: Syrus Akbary <me@syrusakbary.com>
Date:   Thu Jun 24 17:55:25 2021 -0700

    Merge branch 'feature/webc' into js-api-wasi

    # Conflicts:
    #	lib/wasi/src/syscalls/mod.rs

commit 2d3e013e64424c0a50f32f44ad0401680d31bf9d
Author: Mark McCaskey <mark@wasmer.io>
Date:   Thu Jun 24 16:54:43 2021 -0700

    Wip updates for python webc

commit 3a5a687964780d48e8598247009721badd50d496
Author: Mark McCaskey <mark@wasmer.io>
Date:   Wed Jun 23 10:36:06 2021 -0700

    Add patch to get vfs
2021-07-23 23:10:17 -07:00
28079d835a Merge pull request #2408 from Hywan/test-capi
test(c-api) Clean up the `tests/Makefile`
2021-07-19 12:16:04 +02:00
b21adb2aa5 doc(c-api) Fix CHAGNELOG. 2021-07-19 11:37:00 +02:00
e1a675ca8a Merge branch 'master' into test-capi 2021-07-19 11:13:52 +02:00
4255387f49 Rename wasm_instance_new()’s “traps” argument to “trap”.
Issue #2472
2021-07-17 22:12:04 -04:00
d92c4831bf Merge branch 'master' into test-capi 2021-07-13 12:06:37 +02:00
09f1b9103a fix(c-api) Rename lib's name to wasmer.
This patch does several things.

1. For the crate `wasmer-c-api`, the library name is modified from
   `wasmer_c_api` to `wasmer` in `Cargo.toml`. That way, the new
   library files are named `libwasmer.*` rather than
   `libwasmer_c_api.*`. That's the primaly goal of this patch. The
   rest is a consequence of this point. Why do we want that? Because
   the `build.rs` script of the `wasmer-c-api` crate will configure
   the `soname` (on Linux), the `install_name` + `current_version` +
   `compatibility_version` (on macOS), and the `out-implib` +
   `output-def` (on Windows) for a library named `libwasmer`, which is
   the name we provide in the Wasmer package for the Wasmer
   libraries. If we want everything to be testable, we cannot use
   `libwasmer` in `soname` for a file named `libwasmer_c_api` for
   example. If we rename the file when packaging (as it's done prior
   this patch), we would need to re-update all those information in
   the `Makefile`. It implies to duplicate the code in 2 places. So
   let's do things right directly and only once: We want the library
   to be named `libwasmer`, let's do that.

2. For the crate `wasmer-c-api`, since the library name has been
   renamed to `wasmer`, it creates a conflict with the `wasmer` crate
   which is a dependency. Consequently, this patch also updates the
   `Cargo.toml` file to modifiy the dependency name with the special
   `package` attribute (see
   https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml
   to learn more). So now, the `wasmer` refers to the `wasmer_c_api`
   crate, and `wasmer-api` refers to the `wasmer` crate.

3. The code of the `wasmer-c-api` crate is updated accordingly. The
   `WasmerEnv` derive procedural macro fails because it expects a
   crate named `wasmer` (which is now `wasmer_api`), so we implement
   the `WasmerEnv` trait by hand.

4. The patch updates the `build.rs` script of the `wasmer-c-api`
   crate:

  1. In the `build_cdylib_link_arg` function: The dependency to the
     `cdylib-link-lines` crate has been removed because the output is
     not exactly the one we expect. So we compute all the
     `cargo:rustc-cdylib-link-arg=…` lines by hand. The version number
     no longer appears in the library file name for example.

  2. In the `build_inline_c_env_vars` function: Values passed to
     `LDFLAGS` have been updated to be `libwasmer` rather than
     `libwasmer_c_api`.

  3. A new `shared_object_dir` helper function has been created
     because it's used in `build_inline_c_env_vars` and in
     `build_cdylib_link_arg`.

5. The `Makefile` has been updated:

  1. In `package-capi`, we no longer rename `libwasmer_c_api` to
     `libwasmer` since the name is correctly defined since the
     beginning now.

     Calling `install_name_tool` on macOS is no longer required since
     `install_name` is correctly set by the linker in the `build.rs`
     script of `wasmer-c-api`.

  2. In `package-docs`, some stuffs have been fixed, like the
     `SOURCE_VERSION` variable that didn't exist, so removed, or the
     `mkdir` command that was incorrect etc.

  3. In `build-docs`, the `wasmer-c-api` crate is excluded from the
     list of crates to generate the documentation for. Mostly because
     the `build-docs-capi` recipe exists, and we must use it to
     generate the documentation of `wasmer-c-api` now.

  4. In `build-docs-capi`, we generate the documentation for the
     `wasmer-c-api` crate. But `rustdoc` uses the library name for the
     directory name in the `target/doc/` directory. Since the library
     name is now `wasmer`, it creates a conflict with the `wasmer`
     crate. Consequently, we update the library name by using `sed` on
     the `Cargo.toml` file before running `cargo doc`, to finally
     restore `Cargo.toml` as it was previously.
2021-07-08 13:30:20 +02:00
44a83cbdba Merge branch 'master' into feat-capi-cbindgen-0.19 2021-07-06 20:25:00 -05:00
0d6f9f41b1 doc(changelog) Add #2449. 2021-07-06 14:44:51 +02:00
4b783ffd17 feat: Configure soname, install_name, out-implib etc. for the C API.
This patch uses `cdylib-link-lines` to “configure” the cdylib
correctly.
2021-07-06 14:43:30 +02:00
413ead61fe feat(c-api) Update cbindgen to 0.19. 2021-07-01 14:19:37 +02:00
d63ffcd78f doc(c-api) Write documentation for the trap module. 2021-06-25 13:38:26 +02:00
a4349f8719 doc(changelog) Add #2444. 2021-06-25 13:26:02 +02:00
eea75e7862 fix(c-api) Trap's messages are always null terminated.
`wasm_trap_new` expects a `wasm_message_t`. It's a type alias to
`wasm_name_t` with the exception that it represents a null-terminated
string.

When calling `wasm_trap_new`, no check was present to ensure the
string was well-formed. That's a first issue. But in the best
scenario, the string was correctly formed and was
null-terminated. This string was transformed to a Rust `String` —with
the null byte!— and passed to `RuntimeError`.

Then in `wasm_trap_message`, another null byte was pushed at the end
of the message. It's been introduced in
https://github.com/wasmerio/wasmer/pull/1947. It results in a
doubly-null-terminated string, which is incorrect.

This patch does the following:

1. It checks that the string given to `wasm_trap_new` contains a
   null-terminated string or not, and will act accordingly. Note that
   it's possible to pass a non-null-terminated string, and it will
   still work because this detail is vicious. The idea is to get a
   well-formed `RuntimeError` in anycase.

  * If no null byte is found, the string is passed to `RuntimeError`
    as a valid Rust string,

  * If a null byte is found at the end of the string, a new string is
    passed to `RuntimeError` but without the final null byte,

  * If a null byte is found but not at the end, it's considered as an
    error,

  * If the string contains invalid UTF-8 bytes, it's considered as an
    error.

2. It updates `wasm_trap_message` to always add a null byte at the end
   of the returned owned string.

3. It adds test cases when passing a null-terminated or a
   non-null-terminated string to `wasm_trap_new` and to compare the
   results to `wasm_trap_message`.
2021-06-25 11:42:04 +02:00
29d7b4a5f1 doc(c-api) Update links to documentation. 2021-06-18 10:22:11 +02:00