Commit Graph

725 Commits

Author SHA1 Message Date
ptitSeb
630814439e Fixed create-exe WASI programs that will fail to exit properly 2023-03-10 14:47:29 +01:00
Johnathan Sharratt
761fff3c45 More lint and non-unix compile fixes 2023-03-10 13:57:51 +11:00
Johnathan Sharratt
4abbec71c1 Merge remote-tracking branch 'origin/master' into dash-fixes-and-pthreads 2023-03-09 16:14:53 +11:00
Johnathan Sharratt
80b10fcba7 Updates for the review comments 2023-03-09 16:11:42 +11:00
ptitSeb
ed3895b539 Fix doc, threads are enabled by default now (#3665)
* Fix doc, threads are enabled by default now

* Do not remove enable-thread, just mark at as deprecated
2023-03-08 12:08:19 +00:00
Christoph Herzog
5a245f8e7f chore(cli): Replace fern logging implementation with tracing
No point in keeping two implementations around
2023-03-07 11:15:15 +00:00
Johnathan Sharratt
6dde2831a0 Improvements to the tracing and logging in wasmer
- Now using the fmt subscriber for improved formatting
- Using spans on all syscalls
- Added recorded fields on the spans instead trace and debug macros
- Adding timing on all syscall
2023-03-07 11:15:15 +00:00
Syrus Akbary
e61c206bb2 Merge branch 'master' into std-api 2023-03-06 20:50:10 -08:00
Michael-F-Bryan
e258df4dc4 Removed an unused import 2023-03-06 22:52:16 +08:00
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
Syrus Akbary
1c3f9663b5 Merge branch 'master' into std-api
# Conflicts:
#	lib/api/src/js/externals/global.rs
#	lib/api/src/js/vm.rs
#	lib/cli/src/commands/create_exe.rs
#	lib/wasi/src/bin_factory/exec.rs
#	lib/wasi/src/bin_factory/module_cache.rs
#	lib/wasi/src/os/console/mod.rs
#	lib/wasi/src/runtime/task_manager/mod.rs
2023-03-02 11:46:17 -08: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
Syrus Akbary
a0e11bf1de Fixed linting 2023-02-28 00:37:42 -08:00
Syrus Akbary
bef5f9e2e6 Merge branch 'master' into std-api 2023-02-28 00:33:37 -08:00
ptitSeb
2a4b9a7be1 Fix linter 2023-02-28 09:17:28 +01:00
Syrus Akbary
fe72a5ab7f Merge branch 'master' into std-api
# Conflicts:
#	lib/api/src/js/function_env.rs
#	lib/wasi/src/bin_factory/exec.rs
2023-02-27 23:06:25 -08: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
Syrus Akbary
826d32194d Merge branch 'master' into std-api
# Conflicts:
#	lib/api/src/js/mem_access.rs
#	lib/api/src/js/mod.rs
#	lib/api/src/sys/typed_function.rs
#	lib/wasi/src/syscalls/wasix32.rs
#	lib/wasi/src/syscalls/wasix64.rs
#	lib/wasi/src/utils/mod.rs
2023-02-24 14:13:02 -08:00
Syrus Akbary
9ed86ad6db Make cli compilable again 2023-02-24 13:51:37 -08:00
Syrus Akbary
1f64ba13e0 Wrap engine 2023-02-24 13:35:46 -08: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
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
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
Syrus Akbary
92255601fe Merge branch 'master' into std-api
# Conflicts:
#	lib/api/src/sys/instance.rs
2023-02-11 18:19:10 -08: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
Syrus Akbary
543e7cb945 Make CI happy. Fix linting and imports 2023-02-10 08:05:07 -08: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
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