Commit Graph

765 Commits

Author SHA1 Message Date
Michael-F-Bryan
3af48f7028 Hoisted shared state into its own struct 2023-03-06 22:45:51 +08:00
Michael-F-Bryan
bd324f9fc0 Added WCGI-specific flags to the CLI 2023-03-06 22:45:51 +08:00
Michael-F-Bryan
ca52b2e4f7 We can run a WCGI server locally! 2023-03-06 22:45:50 +08:00
Michael-F-Bryan
649c808afe Miscellaneous refactoring and tidy-ups 2023-03-06 22:42:55 +08:00
Michael-F-Bryan
d09b6a512d Fleshed out the WCGI runner integration test 2023-03-06 22:34:17 +08:00
Michael-F-Bryan
91a8d4c598 Wrote integration tests for the WASI and WCGI runners 2023-03-06 22:34:17 +08:00
Michael-F-Bryan
7303fabf35 Started adding a WcgiRunner implementation to the wasmer-wasi crate 2023-03-06 22:34:15 +08:00
Michael-F-Bryan
7d409f8b07 Upgraded everything to use webc v5 2023-03-06 22:30:51 +08:00
Christoph Herzog
5e73761c22 deps: Remove tempdir dependency
We already depend on `tempfile`, which also provides temp dir
functionality.

This gets rid of a cargo-deny error due to a race condition in
remove_dir_all, which is a dependency of the removed "tempdir" crate.

Also bumps the minimum tempfile version in Cargo.toml files to be
consistent.
2023-03-06 07:59:16 +00:00
Johnathan Sharratt
09dcef2b70 Merge remote-tracking branch 'origin' into zero-mem-copy 2023-03-03 17:58:07 +11:00
Johnathan Sharratt
d4601028ef Merge branch 'master' into zero-mem-copy 2023-03-03 17:56:06 +11:00
Johnathan Sharratt
f1c31c65ca All IO operates are now zero copy when on non-browsers while browsers still copy bytes 2023-03-03 16:04:09 +11:00
ptitSeb
a0b530b070 Removed choice for object-format in create-exe and create-obj commands (#3636)
* Removed choice for object-format in create-exe and create-obj commands (and related tests)
* Removed create-obj testing for Symbol object type
* Small change to have intermediary variable instead of a big Some(_)
2023-03-02 10:38:44 +00:00
ptitSeb
2a4b9a7be1 Fix linter 2023-02-28 09:17:28 +01:00
Sven Sauleau
ed0951fbce add basic coredump generation
This change adds a basic coredump generation after a WebAssembly trap
was entered. The coredump includes rudimentary stack / process debugging
information.

A new CLI argument is added to enable coredump generation:

```
wasmer --coredump-on-trap=/path/to/coredump/file module.wasm
```

See docs/en/examples-coredump.md.

Refs https://github.com/wasmerio/wasmer/issues/3578
2023-02-27 21:12:28 +00:00
ptitSeb
5cf54b4f42 [CREATE-EXE] Link with Security framework when cross-compiling on macOS (and the framework definition is embedded in create-exe) 2023-02-23 14:00:14 +01:00
Christoph Herzog
df6434fcac Ensure WasiEnv cleanup in CLI 2023-02-23 10:45:10 +01:00
Christoph Herzog
16e92ff680 Rename SpecialFile to DeviceFile
Because some people don't like anything special in their code base...
2023-02-22 23:19:01 +01:00
Christoph Herzog
4d0460e2c6 Merge remote-tracking branch 'origin/master' into wasix 2023-02-22 11:15:16 +01:00
Christoph Herzog
af746cf284 chore: Don't ignore path creation error in create_exe code 2023-02-22 11:04:31 +01:00
Christoph Herzog
34c5bfe124 c-api: wasi_env_delete now cleans up the WasiEnv state
Needed for proper cleanup of state.
2023-02-22 11:04:31 +01:00
ptitSeb
c9e658e25e Update rkyv 0.7.40 and prettytable-rs to 0.10.0 (#3593) 2023-02-21 12:33:42 +01:00
ptitSeb
dc05bd111b Removed new ExportError::SerializationFailed, as it's not used 2023-02-15 14:50:30 +01:00
ptitSeb
247de6f8bf Fixed wasmer_create_exe_main.c C file for non PIRITA_WASI config 2023-02-15 11:36:46 +01:00
Christoph Herzog
93a0cd6bbf cli: Add a --net flag to run command for enabling networking
WASIX networking will now only be enabled if the --net flag is provided.
Otherwise it would break the Wasmer sandboxing promise.

In the future we should add more advanced networking config.
(like only allow certain ports, limit dns domains, limit ip ranges, etc )
2023-02-15 11:25:17 +01:00
Christoph Herzog
0b6c07a5a7 wasi: Improve global tokio runtime detection in TokioTaskManager
Make sure to not create a new runtime if in an async context already.
2023-02-10 20:22:50 +01:00
Christoph Herzog
02245ce1f0 chore: Fix clippy lints 2023-02-10 11:37:36 +01:00
Christoph Herzog
082715aea3 wasi: Refactor TTY System
* Remove all the STDIO related methods from the WasiRuntime trait

* Remove the special-cased Stdio VirtualFile types that where needed due to
  the above WasiRuntime trait integration

* Replace the WasiRuntime::{get,set}_tty methods with a dedicated optional
  TtyBridge trait

* Update the Console to always require a full WasiBidirectionalPipePair
  which is used for stdio
2023-02-08 19:48:50 +01:00
Christoph Herzog
0819c9a811 build: Remove compiler-specific features from wasi crate
For historic reasons the wasi crate had features to toggle between the
different Wasmer compilers.

This is not needed anymore.
2023-02-08 17:26:42 +01:00
Christoph Herzog
ff4ccf5083 refactor(wasi): Make WasiState private
Makes the WasiState type private, and replaces it's usage with WasiEnv
where needed.

WasiState is a complex type with many implementation details, it should
not be public.
2023-02-08 16:52:30 +01:00
Christoph Herzog
8b0d1fc302 wasi: Partial unification of instance spawning
Introduces a new WasiEnvInit type that should hold all information
required for initializing an instance.

An instance can then be created with WasiEnv::instantiate().
This method takes care of all the required setup steps to properly run a
wasi(X) module.
2023-02-08 14:36:01 +01:00
Christoph Herzog
956ad2821a Improve WasiBuilder API
First step in improving the wasi module construction flow.
Lots of steps to follow.
2023-02-08 12:54:08 +01:00
Christoph Herzog
7f8c0858b3 Merge remote-tracking branch 'origin/master' into wasix 2023-02-07 11:38:04 +01:00
Felix Schütt
4360c6faa0 Fix CLI unit tests 2023-02-03 07:34:32 +01:00
Felix Schütt
e25f0a981c Fix make lint 2023-02-03 00:17:55 +01:00
Felix Schütt
6a276075fd Merge branch 'master' into fix-create-exe-underscore 2023-02-02 23:29:55 +01:00
Christoph Herzog
50dd7270a5 Delete unused C file (rebase left-over)
File is an artifact of a big rebase, not needed any longer.
2023-02-02 22:12:23 +01:00
Christoph Herzog
a3cda991a3 Merge remote-tracking branch 'origin/master' into wasix 2023-02-02 19:23:13 +01:00
Felix Schütt
419e8cf132 Fix unit test 2023-02-02 16:15:26 +01:00
Syrus Akbary
545a12ac93 Update login.rs 2023-02-02 15:58:20 +01:00
Syrus Akbary
d2bc1a6a60 Update login.rs 2023-02-02 15:57:57 +01:00
Christoph Herzog
28620c88f4 Merge branch 'master' into wasix 2023-01-30 13:42:11 +01:00
Felix Schütt
61059a746f Change order of iterating to prefer -headless library when linking 2023-01-30 09:45:13 +01:00
Felix Schütt
0dbf1126c6 Switch back to wasmer-headless 2023-01-30 08:19:57 +01:00
Christoph Herzog
42f58d0c98 Merge remote-tracking branch 'origin/master' into wasix 2023-01-28 08:30:02 +01:00
Felix Schütt
6ef51c7e09 Fix make lint 2023-01-27 10:00:10 +01:00
Felix Schütt
3ea338c0e5 Link with libwasmer-headless 2023-01-27 09:40:05 +01:00
Felix Schütt
e3db893dd9 Merge branch 'master' into fix-caching-issue-customlambda 2023-01-26 10:53:12 +01:00
Christoph Herzog
f5cfb59090 chore: Update comment to reflect implementation changes
Because an outdated comment is the worst kind of comment.
2023-01-24 20:24:34 +01:00
Christoph Herzog
d1bae195b3 Merge remote-tracking branch 'origin/master' into wasix 2023-01-23 22:00:16 +01:00