Commit Graph

241 Commits

Author SHA1 Message Date
Felix Schütt
d2364f40bb Update versions via script 2022-11-02 14:52:12 +01:00
Felix Schütt
37f88c97e5 Fix cargo deny 2022-10-28 14:34:41 +02:00
Felix Schütt
178f469506 Fix make lint 2022-10-28 11:48:53 +02:00
Felix Schütt
7e76db8490 Fixed most dependency errors 2022-10-27 18:42:32 +02:00
Felix Schütt
87aa82f33b cargo fmt 2022-10-27 17:24:37 +02:00
Felix Schütt
afdffbe579 cargo fmt 2022-10-27 16:54:23 +02:00
Felix Schütt
968d74c556 Add webc-vfs 2022-10-27 16:53:10 +02:00
Felix Schütt
8ee578fb5d Update package versions 2022-10-25 12:54:45 +02:00
Felix Schütt
28645c14cc Fix bug in mem_fs: parent of foo.txt is root dir 2022-10-24 23:34:50 +02:00
Felix Schütt
dc33e1baa6 Adress review comment (code style) 2022-10-24 19:09:44 +02:00
Felix Schütt
508b96fa17 Added proper fix for fd_rights issue 2022-10-24 16:12:46 +02:00
Felix Schütt
fdda18d949 Implement fix for fd_rights test 2022-10-20 22:58:54 +02:00
ptitSeb
42afe0ad14 Fix linter 2022-10-18 18:16:24 +02:00
ptitSeb
57af56a5f0 Update lib/vfs/src/mem_fs/filesystem.rs
Co-authored-by: Michael Bryan <michaelfbryan@gmail.com>
2022-10-18 17:44:46 +02:00
ptitSeb
d3da77602d Added a test to check if rename can overwrite destination, fixing also the syscall and mem_fs 2022-10-18 17:19:48 +02:00
Felix Schütt
fef756412f Update 3.0.0-beta -> 3.0.0-beta.2 2022-09-26 12:20:35 +02:00
Manos Pitsidianakis
c570b1471a Bump version to 3.0.0-beta in Cargo manifests 2022-08-08 19:56:35 +03:00
Manos Pitsidianakis
430a7e2e19 Make serde optional everywhere with enable-serde feature flag 2022-08-02 15:45:28 +03:00
Felix Schütt
9f1845a2d1 Fix clippy lints and "make lint" 2022-07-30 11:31:10 +03:00
Felix Schütt
011d36829a Bump 3.0.0-alpha.3 to 3.0.0-alpha.4 2022-07-30 11:31:08 +03:00
Felix Schütt
1c3ffffe46 Bump 3.0.0-alpha.2 to 3.0.0-alpha.3 2022-07-30 11:30:45 +03:00
Felix Schütt
02ee80cf10 Bump version to 3.0.0-alpha.2 2022-07-30 11:30:07 +03:00
Felix Schütt
6c045bff10 Bump version to 3.0.0-alpha.1 to fix botched compiler crate 2022-07-30 11:29:41 +03:00
Felix Schütt
8959008403 Update version to 3.0.0-alpha 2022-07-30 11:29:05 +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
John Sharratt's Shared Account
7bf6d30459 Added stdin, stdout and stderr methods to WasiState for wasmer consumers
And converted the WASI js test into a generic stdio test that works for
both sys and js versions of wasmer (also fixed the tests)
2022-06-15 19:26:57 +03:00
ptitSeb
3e9de243a5 Fix lint warnings/errors 2022-06-15 19:26:57 +03:00
Johnathan Sharratt
62de9c5aad Implemented functionality needed for WASIX and Networking within Web Assembly
- Introduced the virtual BUS interface used for RPC between web assembly apps
- Introduced the virtual networking interface used to implement networking
  for web assembly apps
- Implemented a local implementation of the virtual networking
  (available behind the feature toggle 'host-net' on the 'wasi' package)
- Fixed up some of the examples from the wasmer3 branch
- Refactored the WASI implementations so they support wasm64-wasi
- WASIX is behind its own namespaces for both 32bit and 64bit implementations
- Fixed the wasi_pipes unit test which was using internals that are no longer exposed - instead made the pipes clonable
2022-06-15 19:24:40 +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
Manos Pitsidianakis
33654c1a1d Release version 2.3.0 2022-06-06 22:27:57 +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
bors[bot]
fc794ab4e3 Merge #2807
2807: Run Wasm code on a separate stack r=Amanieu a=Amanieu

This uses the [corosensei](https://crates.io/crates/corosensei) crate to
run Wasm code on a separate stack from the main thread stack.

In trap handlers for stack overflows and memory out of bounds accesses,
we can now check whether we are executing on the Wasm stack and reset
execution back to the main thread stack when returning from the trap
handler.

When Wasm code needs to perform an operation which may modify internal
data structures (e.g. growing a memory) then execution must switch back
to the main thread stack using on_host_stack. This is necessary to avoid
leaving internal data structure in an inconsistent state when a stack
overflow happens.

In the future, this can also be used to suspend execution of a Wasm
module (#1127) by modeling it as an async function call.

Fixes #2757
Fixes #2562


Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
2022-03-16 13:24:50 +00:00
Amanieu d'Antras
fe9d2d8d22 Release version 2.2.1 2022-03-15 11:02:31 +00:00
Amanieu d'Antras
83fd79057e Fix unused field lint 2022-03-14 22:14:22 +00:00
Amanieu d'Antras
4dd1634218 Release version 2.2.0 2022-02-28 17:19:14 +00:00
Amanieu d'Antras
15f9d2646f Release version 2.2.0-rc1 2022-02-15 19:10:24 +00:00
Amanieu d'Antras
4e27e1164c Release version 2.2.0-rc1 2022-01-27 23:59:27 +00:00
Amanieu d'Antras
ebcea4a5c4 Release v2.1.1 2021-12-21 12:19:50 +01:00
Amanieu d'Antras
c650ffea33 Version 2.1.0 2021-11-30 23:46:54 +00:00
Syrus Akbary
65ee1c95a9 Improvements to the FS API 2021-11-30 20:50:01 +01:00
Benjamin Coenen
e0e12f9d9f feat(wasi): add rename for a directory + fix remove_dir
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2021-09-07 13:55:24 +02:00
Benjamin Coenen
08580b5331 wip
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2021-09-06 13:55:31 +02:00
bors[bot]
d07997e337 Merge #2551
2551: feat(vfs) Add ability to rename a file with `mem_fs` r=Hywan a=Hywan

# Description

This patch updates `wasmer_vfs::mem_fs::FileSystem::rename` to handle file. Directories were handle previously, but not file.

~~Tests must be added though.~~

It solves the last bits of https://github.com/wasmerio/wasmer/pull/2546.

Co-authored-by: Ivan Enderlin <ivan@mnt.io>
2021-09-03 08:39:02 +00:00
Ivan Enderlin
3d27db87d1 feat(vfs) Add test cases for mem_fs::FileSystem::rename.
This patch adds test cases for renaming a file or a directory, and for
renaming + moving. That's different because this patch also implements
a shortcut when a file or directory is simply renamed, we don't need
to update the parent's children, only the modified time.
2021-09-03 10:26:17 +02:00
Ivan Enderlin
af6dc307e9 feat(vfs) Add ability to rename a file with mem_fs. 2021-09-02 16:33:03 +02:00
Ivan Enderlin
9581dec15f feat(vfs) Update Metadata.len when updating the file buffer. 2021-09-02 15:56:50 +02:00
Ivan Enderlin
8d202682a7 fix(vfs) Opening in append-mode must ignore seek operations.
When opening a file with the `append` option turned on, all `seek`
operations must be ignored. As described by
[`open(2)`](https://man7.org/linux/man-pages/man2/open.2.html), the
`O_APPEND` option describes this behavior well:

> Before each write(2), the file offset is positioned at
> the end of the file, as if with lseek(2).  The
> modification of the file offset and the write operation
> are performed as a single atomic step.
>
> O_APPEND may lead to corrupted files on NFS filesystems
> if more than one process appends data to a file at once.
> This is because NFS does not support appending to a file,
> so the client kernel has to simulate it, which can't be
> done without a race condition.

This patch implements that behavior.
Also, this patch rewind the file cursor if opened in read-mode.
2021-08-31 15:08:46 +02:00
Ivan Enderlin
87558a9b0e feat(vfs) mem-fs does not support enable-serde. 2021-08-30 17:32:47 +02:00
Ivan Enderlin
bb47a47f27 chore(vfs) Remove Clippy warnings. 2021-08-30 16:01:05 +02:00