Commit Graph

725 Commits

Author SHA1 Message Date
ptitSeb
436bec735b Using IntoBytes only for Module::deserialise (both sys and js) 2022-09-01 13:52:53 +02:00
ptitSeb
1912373e1f The API breaking changes from future WASIX/Network/Threading addition 2022-08-26 10:46:56 +02:00
Felix Schütt
63a9a98c0d Merge branch 'master' into fix-wasmer-cache-panic-2 2022-08-25 12:21:23 +02:00
Felix Schütt
a869daea91 Fix cache path not being present during installation of cross-tarball 2022-08-24 18:07:35 +02:00
Felix Schütt
6988025cd0 Fix make lint 2022-08-23 15:24:13 +02:00
Manos Pitsidianakis
4fdbd344af create-obj: remove dead code 2022-08-21 16:25:52 +03:00
Manos Pitsidianakis
bc9ed1a5c1 create-exe: use absolute paths everywhere 2022-08-21 16:25:52 +03:00
Manos Pitsidianakis
306347e1b9 create-exe: fix serialized create-exe not working
Unified generated objects interfaces: both static and serialized objects
expose the same function signature to create the module:

  wasm_module_t* wasmer_object_module_new(wasm_store_t* store, const char* module_name);
2022-08-21 16:25:52 +03:00
Manos Pitsidianakis
70f30e4458 create-exe: Prefer libwasmer-headless when cross-compiling 2022-08-12 17:41:29 +03:00
Manos Pitsidianakis
74dae4a716 create-exe: list supported cross-compilation target triples in help text
Closes #3087
2022-08-11 18:51:57 +03:00
Manos Pitsidianakis
cad678e0d1 create-exe: use cached wasmer tarballs for network fetches
Closes #3085
2022-08-11 17:54:29 +03:00
Syrus Akbary
5cb63cc8e5 Added version to the wasmer cli 2022-08-10 17:39:48 +02:00
Wolfgang Silbermayr
1c67ec7894 Resolve clap TODO items 2022-08-08 15:51:39 +02:00
Wolfgang Silbermayr
2a385c7882 Migrate to clap from structopt 2022-08-08 15:51:37 +02:00
Manos Pitsidianakis
ba543fc4f7 Add support for cross-compiling in create-exe with zig cc WIP (#3076)
* Add support for cross-compiling in create-exe with zig cc WIP

zig version must be at least 0.10.0-dev.3431+4a4f3c50c

Closes #3042

* Add support for cross-compiling in create-exe with zig cc WIP

zig version must be at least 0.10.0-dev.3431+4a4f3c50c

Closes #3042

* Add SSE2 features to the CPU

* Add SSE2 features to the CPU

* create_exe: locate zig binary and check minimum version

Check that `zig` binary version is at least `0.10.0`

* create-exe: refactor cross-comp cli parsing and error checks

* create-exe: add -lunwind for cross-comp with zig

* Set the proper library for windows

* create-exe: add path exists check for --tarball value

* create-exe: add -msvc environment in triple_to_zig_triple()

Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2022-08-08 15:32:15 +02:00
Felix Schütt
520314bbf0 Fix errors from "make lint" 2022-08-05 15:40:32 +02:00
Manos Pitsidianakis
e002240c2f wasmer-cli: Allow create-exe to receive a static object as input
Allow create-exe to receive an object created by `wasmer create-obj`
instead of a wasm module as input to skip the compilation part. The
accompanying header file must be specified with the `--header` flag in
order for the input file to be recognized as an object.
2022-08-04 09:24:30 +03:00
Manos Pitsidianakis
fa5152207a create-obj: add header file output and CLI flag for it 2022-08-03 14:54:56 +03:00
Manos Pitsidianakis
951e09634b cli: add documentation on create-{exe,obj} 2022-08-03 14:54:56 +03:00
Manos Pitsidianakis
1ad352610a create-exe: fix linking for macos 2022-08-03 14:54:56 +03:00
Manos Pitsidianakis
83a97f5533 cli: add create-obj command
lib/compiler: read static object
2022-08-03 10:37:45 +03:00
Manos Pitsidianakis
8b096a504e compiler: add wasmer-artifact-load,wasmer-artifact-create,static-artifact-load,static-artifact-create feature flags 2022-08-02 15:45:28 +03:00
Manos Pitsidianakis
8215b65494 cli: initialize wasienv memory in create-exe 2022-07-29 10:40:31 +03:00
Manos Pitsidianakis
a02ff59a0f cli: re-introduce create-exe functionality 2022-07-29 10:40:23 +03:00
Syrus Akbary
4384ddf9cd Improved EngineBuilder and Store API
- Store::new() now takes an impl Into<Engine>.
- Added Into<Engine> impls in each of the compilers
- Updated docs/migration_to_3.0.0.md on API usage
2022-07-28 15:20:26 +03:00
Manos Pitsidianakis
214346af3b Merge Backend into EngineBuilder and refactor feature flags 2022-07-27 21:03:24 +03:00
Manos Pitsidianakis
924d2dcf4e Remove Universal mentions from cargo features 2022-07-25 14:45:27 +03:00
Manos Pitsidianakis
4a06b1d3f6 Rename engine's Universal type to Backend
The Universal type was essentially a builder of engines that's given a
compiler backend and creates an Engine with .engine() method. The name
was not clear.
2022-07-25 13:23:13 +03:00
Manos Pitsidianakis
c2ecb99142 Rename UniversalArtifact to Artifact 2022-07-25 13:21:43 +03:00
Manos Pitsidianakis
51be5d0860 Rename UniversalEngine to Engine 2022-07-25 13:21:41 +03:00
Manos Pitsidianakis
987a90c0dc Remove Engine trait 2022-07-25 13:19:32 +03:00
Felix Schütt
35d880d302 cargo fmt 2022-07-22 16:52:00 +02:00
Felix Schütt
343594524b Fix --invoke [function] to behave the same as "run" (closes #2978) 2022-07-22 16:52:00 +02:00
Syrus Akbary
a419ccdf52 Move Webassembly objects to Store and remove Context
Co-authored-by: ptitSeb <sebastien.chev@gmail.com>
Co-authored-by: Manos Pitsidianakis <manos@wasmer.io>
2022-07-19 15:31:51 +03:00
Manos Pitsidianakis
34a6511e16 Port C API to new Context API 2022-07-19 15:31:51 +03:00
ptitSeb
bc58b713db Migrate wasmer-cli to new Context API 2022-07-19 15:31:51 +03:00
Felix Schütt
529e46d988 Support --invoke option for emscripten files without _start function 2022-07-12 11:38:37 +03:00
Manos Pitsidianakis
f744bac1a2 Store: replace new() with new_with_engine() and make new() take CompilerConfig
Since there's one engine now, it doesn't make sense to initialize a
`Store` with the engine specifically. It's an extra redundant step for
the API user.
2022-06-16 16:57:45 +03:00
Manos Pitsidianakis
7bf5d9d1e3 wasmer-cli: remove configuration options for engines
Since there's now only one engine, no need to expose it to the user.
2022-06-16 16:57:45 +03:00
Manos Pitsidianakis
086205bfcc Remove wasmer_engine_universal{,_artifact} and merge into wasmer_compiler 2022-06-16 16:57:45 +03:00
Manos Pitsidianakis
8be0089893 Remove engine-staticlib 2022-06-16 16:57:45 +03:00
Manos Pitsidianakis
e9d54e130c Remove engine-dylib 2022-06-16 16:57:45 +03:00
ptitSeb
0cd9dfe3e0 Fixed linter warnings/errors 2022-06-15 19:26:57 +03:00
Johnathan Sharratt
b0709e4153 Implemented multithreading and fixed a number of bugs with WASIX 2022-06-15 19:26:57 +03:00
ptitSeb
3e9de243a5 Fix lint warnings/errors 2022-06-15 19:26:57 +03:00
Johnathan Sharratt
7c532813e7 Multiple changes required to implement the wasmer terminal on the browser
- Split functionality out of WasiEnv so that it can support multi-threading
- Added methods to the VFS File Trait that supporting polling
- Implemented basic time functionality for WASI
- Incorported a yield callback for when WASI processes idle
- Improved the error handling on WASI IO calls
- Reduce the verbose logging on some critical WASI calls (write/read)
- Implemented the missing poll functionality for WASI processes
- Moved the syspoll functionality behind a feature flag to default to WASI method
- Refactored the thread sleeping functionality for WASI processes
- Fixed the files system benchmark which was not compiling
- Modified the file system trait so that it is SYNC and thus can handle multiple threads
- Removed the large mutex around filesystem state and implemented granular locks instead
  (this is needed to fix a deadlock scenario on the terminal)
- Split the inodes object apart from the state to fix the deadlock scenario.
- Few minor fixes to some warnings when not using certain features
- Sleeping will now call a callback that can be used by the runtime operator when
  a WASI thread goes to sleep (for instance to do other work)
- Fixed a bug where paths that exist on the real file system are leaking into VFS
- Timing functions now properly return a time precision on WASI
- Some improved macros for error handling within syscalls (wasi_try_ok!)
- Refactored the remove_directory WASI function which was not working properly
- Refactored the unlink WASI function which was not working properly
- Refactored the poll WASI function which was not working properly
- Updates some of the tests to make them compile again
- Rewrote the OutputCapturer so that it does leak into the internals
2022-06-15 12:00:24 +02:00
Wolfgang Silbermayr
5339f7cdae Fix clippy lints
Fixes: #2926
2022-06-09 16:05:53 +02:00
Manos Pitsidianakis
8aa225a192 api/sys: Replace ImportObject with new type Imports 2022-06-08 14:09:40 +03:00
Manos Pitsidianakis
77af8ba634 Fix some clippy lints
Before:
```
% make lint 2>&1 | grep warnings | sort | uniq
error: could not compile `wasmer-cli` due to previous error; 25 warnings emitted
warning: `compiler-test-derive` (lib) generated 8 warnings
warning: `test-generator` (lib) generated 4 warnings
warning: `wasi-test-generator` (bin "wasi-test-generator") generated 8 warnings
warning: `wasmer-cache` (lib) generated 4 warnings
warning: `wasmer-cli` (lib) generated 25 warnings
warning: `wasmer-compiler-cranelift` (lib) generated 50 warnings
warning: `wasmer-compiler-singlepass` (lib) generated 228 warnings
warning: `wasmer-compiler` (lib) generated 3 warnings
warning: `wasmer-emscripten` (lib) generated 182 warnings
warning: `wasmer-engine-dummy` (lib) generated 6 warnings
warning: `wasmer-engine-dylib` (lib) generated 37 warnings
warning: `wasmer-engine-staticlib` (lib) generated 16 warnings
warning: `wasmer-engine-staticlib` (lib) generated 7 warnings
warning: `wasmer-engine-universal` (lib) generated 11 warnings
warning: `wasmer-engine` (lib) generated 15 warnings
warning: `wasmer-object` (lib) generated 5 warnings
warning: `wasmer-types` (lib) generated 31 warnings
warning: `wasmer-vfs` (lib) generated 4 warnings
warning: `wasmer-vm` (lib) generated 40 warnings
warning: `wasmer-wasi-experimental-io-devices` (lib) generated 11 warnings
warning: `wasmer-wasi-types` (lib) generated 3 warnings
warning: `wasmer-wasi` (lib) generated 13 warnings
warning: `wasmer-wast` (lib) generated 11 warnings
warning: `wasmer` (lib) generated 54 warnings
```

After:
```
warning: `wasmer-cli` (lib) generated 16 warnings
warning: `wasmer-compiler-cranelift` (lib) generated 48 warnings
warning: `wasmer-compiler-singlepass` (lib) generated 213 warnings
warning: `wasmer-emscripten` (lib) generated 170 warnings
warning: `wasmer-engine-dummy` (lib) generated 6 warnings
warning: `wasmer-engine-dylib` (lib) generated 4 warnings
warning: `wasmer-engine-staticlib` (lib) generated 14 warnings
warning: `wasmer-engine-staticlib` (lib) generated 5 warnings
warning: `wasmer-engine-universal` (lib) generated 9 warnings
warning: `wasmer-engine` (lib) generated 12 warnings
warning: `wasmer-object` (lib) generated 3 warnings
warning: `wasmer-types` (lib) generated 7 warnings
warning: `wasmer-vm` (lib) generated 36 warnings
warning: `wasmer-wasi-experimental-io-devices` (lib) generated 6 warnings
warning: `wasmer-wasi-types` (lib) generated 3 warnings
warning: `wasmer-wasi` (lib) generated 9 warnings
warning: `wasmer-wast` (lib) generated 9 warnings
warning: `wasmer` (lib) generated 42 warnings
```
2022-04-20 18:25:04 +03:00
Julius Michaelis
3bb95d51ed Use unix_mode crate to check file modes in binfmt registration 2022-01-07 22:13:59 +09:00