Nick Lewycky
d589d83d09
Don't #include inside extern "C" blocks.
...
Also free the malloc'd error string in print_wasmer_error().
Run the C code through clang-format.
2021-02-10 18:00:58 -08:00
Nick Lewycky
f1008783f7
Fix typo.
2021-02-10 17:56:06 -08:00
Nick Lewycky
e698ac32ee
Add bcrypt which is required by newer getrandom crate on Windows.
2021-02-10 17:52:12 -08:00
jubianchi
835b50094b
fix: cflags emitted by wasmer config --pkg-config are now correct
...
Closes #1989
2021-02-08 13:29:32 +01:00
Syrus Akbary
77f2e85473
Fix create-exe in Windows
2021-02-04 18:42:00 -08:00
Ivan Enderlin
453ece6415
fix(c-api) Call wasi_env_delete manually.
...
`wasi_get_imports` isn't taking ownership of `wasi_env_t` (despites
what is written in the documentation). And it must not take ownership
of it, since one could use it with the `wasi_env_read_stdout` &
sibling functions after having called `wasi_get_imports`.
Consequently, this patch calls `wasi_env_delete` to avoid leaking
memory.
2021-02-02 14:29:10 +01:00
Ivan Enderlin
0bf86c8d01
feat(cli) Trim environment variables before parsing them.
2021-01-22 13:59:30 +01:00
Ivan Enderlin
802ccc6d80
feat(cli) Improve environment variables parsing.
...
The following environment variables are considered incorrect:
* `A`, no equal sign,
* `A=`, value is missing,
* `=A`, key is missing.
The following environment variables are considered correct:
* `A=B` with `A` for the name and `B` for the value,
* `A=B=C` with `A` for the name and `B=C` for the value.
2021-01-22 13:50:20 +01:00
Mark McCaskey
470dd80a3f
Create separate wasmer-headless binary
2021-01-12 14:40:55 -08:00
Mark McCaskey
ba52b4553e
Fix typo feature "compile" -> "compiler"
2021-01-12 13:10:11 -08:00
Mark McCaskey
88b4093646
Add packaging of headless wasmer to CI
2021-01-12 13:07:07 -08:00
Mark McCaskey
3f39b968f5
Make get_recommended_function return Result
2021-01-07 11:14:31 -08:00
Mark McCaskey
93fa0f008e
Handle error case of emscripten + wasi module
2021-01-07 07:40:34 -08:00
Mark McCaskey
f86a98ec16
Run rustfmt
2020-12-04 17:48:40 -08:00
Syrus Akbary
5c3597845b
Fix wasmer cli
2020-12-04 16:45:26 -08:00
Syrus
13e6f29c29
Set compiler config to be owned (following wasm-c-api)
2020-12-04 02:39:19 -08:00
Nick Lewycky
6a26e93bd2
Fix typo in comment in template of generated code.
2020-12-02 15:54:48 -08:00
Mark McCaskey
4ef3286f2e
Merge branch 'master' into feature/host-env-prototype
2020-11-30 16:52:34 -08:00
Syrus Akbary
1f66798bed
All WASI tests now pass in Apple Silicon
2020-11-19 19:25:57 -08:00
Mark McCaskey
2b0464a4b2
Port wasmer-emscripten to use WasmerEnv
2020-11-17 16:19:00 -08:00
Mark McCaskey
78f958b52c
Clean up misc code
2020-10-29 13:07:04 -07:00
Mark McCaskey
5b67b2f3dc
Merge branch 'master' into feature/host-env-prototype
2020-10-27 16:24:00 -07:00
jubianchi
2452b9a604
chore(doc): Add the Wasmer logo to the generated API documentation
2020-10-26 22:37:30 +01:00
Mark McCaskey
46204d6357
Fix up more tests
2020-10-21 12:00:30 -07:00
Mark McCaskey
011ec22d43
Merge branch 'master' into feature/host-env-prototype
2020-10-20 15:46:50 -07:00
Mark McCaskey
3c7dfe29f3
Add hacked together vertical slice of host env updating idea
2020-10-19 17:19:46 -07:00
Mark McCaskey
c5df8cfd9e
Fix func_calls to not pass NULL but WASM_EMPTY_VEC
2020-10-19 14:50:39 -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
2175472c6d
When running in WASI, get the _start function explicitly
2020-10-16 13:43:14 -07:00
Ivan Enderlin
1cdb5b5876
fix(c-api) Fix another typo. Damn.
2020-10-16 21:24:36 +02:00
Ivan Enderlin
3b05c2612d
fix(c-api) Fix last edit of the wasmer_create_exe_main.c file.
2020-10-16 20:44:49 +02:00
Ivan Enderlin
4f9932c350
feat(cli) Update the crate_exe_main.c file to the latest Wasm C API.
2020-10-16 10:46:28 +02:00
Syrus
38ebdb94ef
added create-exe as possible cli option
2020-10-13 18:33:51 -07:00
Mark McCaskey
3a59e8a59d
Fix mistake in name of C API lib on Windows
2020-10-13 14:45:19 -07:00
Mark McCaskey
aeb17cda6a
Fix cfg logic in wasmer.rs again
2020-10-12 16:30:13 -07:00
Mark McCaskey
fc11c10063
Add comment about why Windows is using clang++
2020-10-12 16:25:40 -07:00
Mark McCaskey
e430bbaf4f
More explicitly feature gate wasmer create-exe
2020-10-12 16:17:34 -07:00
Mark McCaskey
fd63ddb101
Merge branch 'master' into feature/wasmer-create-exe
2020-10-12 15:54:54 -07:00
Mark McCaskey
81fd4fc042
Clean create-exe code a bit
2020-10-12 15:53:46 -07:00
Mark McCaskey
a0b237c1f6
Add test using mapdir and dir, fix misc bugs
2020-10-12 15:04:25 -07:00
Mark McCaskey
21c1770426
Improve error message when WASMER_DIR is not set
2020-10-12 13:51:03 -07:00
Mark McCaskey
c6460d1d77
Add target support to wasmer create-exe
2020-10-12 13:48:26 -07:00
Mark McCaskey
ba7b24f696
Add --dir and --mapdir support to native executable
2020-10-09 17:38:14 -07:00
Nick Lewycky
fbad7ad25c
Running clippy again found two more improvements.
...
Missed a manual memcpy loop in engine-object-file.
CompilerType::enabled() is a Vec<>, so just use is_empty() instead of trying to generically determine whether an Iter is empty.
2020-10-08 21:10:35 -07:00
Nick Lewycky
3b3882f9f5
NFC. Remove redundant return.
2020-10-08 21:04:44 -07:00
Nick Lewycky
03297ab993
Use a non-looping push to push a single element.
...
https://rust-lang.github.io/rust-clippy/master/index.html#single_char_push_str
2020-10-08 20:59:48 -07:00
Nick Lewycky
633310899f
Remove redundant clones of string.
...
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
2020-10-08 20:58:53 -07:00
Nick Lewycky
39d87f4e51
Test whether a list is empty by looking at one value, no need for map + collect.
...
https://rust-lang.github.io/rust-clippy/master/index.html#needless_collect
2020-10-08 20:56:36 -07:00
Nick Lewycky
f8a7ee20c3
Always write out the whole header file.
...
write() may return after completing part of a write and returns the amount written. Use write_all().
https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount
2020-10-08 19:38:52 -07:00
Mark McCaskey
65265dbd73
Add first draft of wasmer create-exe
2020-10-08 14:13:54 -07:00