mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 13:18:20 +00:00
Merge branch 'master' into master
This commit is contained in:
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@@ -217,6 +217,11 @@ jobs:
|
|||||||
rustup override set nightly
|
rustup override set nightly
|
||||||
make build-wasmer-headless-minimal
|
make build-wasmer-headless-minimal
|
||||||
rustup override set stable
|
rustup override set stable
|
||||||
|
- name: Build Wasmer with minimal "sys" features
|
||||||
|
run: |
|
||||||
|
cargo build --no-default-features --features="sys" --manifest-path=lib/api/Cargo.toml &&
|
||||||
|
cargo build --manifest-path=lib/cache/Cargo.toml &&
|
||||||
|
cargo build --manifest-path=lib/vbus/Cargo.toml
|
||||||
- name: Dist
|
- name: Dist
|
||||||
if: matrix.build != 'macos-arm64'
|
if: matrix.build != 'macos-arm64'
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
63
CHANGELOG.md
63
CHANGELOG.md
@@ -8,24 +8,67 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C
|
|||||||
|
|
||||||
## **Unreleased**
|
## **Unreleased**
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- [#3047](https://github.com/wasmerio/wasmer/pull/3047) `Store::new` now takes an `impl Into<Engine>`.
|
|
||||||
- [#3017](https://github.com/wasmerio/wasmer/pull/3017) Fix typo in README.md
|
|
||||||
- [#3008](https://github.com/wasmerio/wasmer/pull/3008) Add a new CI check that uses cargo public-api to track changes in the API between master and the last deployed version on crates.io
|
|
||||||
- [#3003](https://github.com/wasmerio/wasmer/pull/3003) Remove RuntimeError::raise from public API
|
|
||||||
- [#2999](https://github.com/wasmerio/wasmer/pull/2999) Allow `--invoke` CLI option for Emscripten files without a `main` function
|
|
||||||
- [#2997](https://github.com/wasmerio/wasmer/pull/2997) Fix "run --invoke [function]" to behave the same as "run"
|
|
||||||
- [#2946](https://github.com/wasmerio/wasmer/pull/2946) Remove dylib,staticlib engines in favor of a single Universal engine
|
|
||||||
- [#2949](https://github.com/wasmerio/wasmer/pull/2949) Switch back to using custom LLVM builds on CI
|
|
||||||
- #2892 Renamed `get_native_function` to `get_typed_function`, marked former as deprecated.
|
|
||||||
- [#3029](https://github.com/wasmerio/wasmer/pull/3029) Removed Artifact, Engine traits. Renamed UniversalArtifact to Artifact, and UniversalEngine to Engine.
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
## 3.0.0-alpha.4 - 2022/07/28
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- [#3035](https://github.com/wasmerio/wasmer/pull/3035) Added a simple "divide by zero" wast test, for #1899, as the trap information are correctly tracked on singlepass now
|
||||||
|
- [#3021](https://github.com/wasmerio/wasmer/pull/3021) Add back missing Aarch64 relocations (needed for llvm compiler)
|
||||||
|
- [#3008](https://github.com/wasmerio/wasmer/pull/3008) Add a new cargo public-api CI check
|
||||||
|
- [#2941](https://github.com/wasmerio/wasmer/pull/2941) Implementation of WASIX and a fully networking for Web Assembly
|
||||||
|
- [#2952](https://github.com/wasmerio/wasmer/pull/2952) CI: add make build-wasmer-wasm test
|
||||||
|
- [#2982](https://github.com/wasmerio/wasmer/pull/2982) Add a rustfmt.toml file to the repository
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- [#3047](https://github.com/wasmerio/wasmer/pull/3047) `Store::new` now takes an `impl Into<Engine>`.
|
||||||
|
- [#3046](https://github.com/wasmerio/wasmer/pull/3046) Merge Backend into EngineBuilder and refactor feature flags
|
||||||
|
- [#3039](https://github.com/wasmerio/wasmer/pull/3039) Improved hashing/ids of function envs
|
||||||
|
- [#3031](https://github.com/wasmerio/wasmer/pull/3031) Update docs/migration_to_3.0.0.md
|
||||||
|
- [#3030](https://github.com/wasmerio/wasmer/pull/3030) Remove cranelift dependency from wasmer-wasi
|
||||||
|
- [#3029](https://github.com/wasmerio/wasmer/pull/3029) Removed Artifact, Engine traits. Renamed UniversalArtifact to Artifact, and UniversalEngine to Engine.
|
||||||
|
- [#3028](https://github.com/wasmerio/wasmer/pull/3028) Rename old variable names from ctx to env (in case of FunctionEnv usage) and from ctx to store in case of store usage
|
||||||
|
- [#3023](https://github.com/wasmerio/wasmer/pull/3023) Changed CI "rust install" action to dtolnay one
|
||||||
|
- [#3013](https://github.com/wasmerio/wasmer/pull/3013) Refactor Context API
|
||||||
|
- [#3003](https://github.com/wasmerio/wasmer/pull/3003) Remove RuntimeError::raise from public API
|
||||||
|
- [#3000](https://github.com/wasmerio/wasmer/pull/3001) Allow debugging of EXC_BAD_INSTRUCTION on macOS
|
||||||
|
- [#2999](https://github.com/wasmerio/wasmer/pull/2999) Allow `--invoke` CLI option for Emscripten files without a `main` function
|
||||||
|
- [#2996](https://github.com/wasmerio/wasmer/pull/2996) Migrated all examples to new Context API
|
||||||
|
- [#2946](https://github.com/wasmerio/wasmer/pull/2946) Remove dylib,staticlib engines in favor of a single Universal engine
|
||||||
|
- [#2949](https://github.com/wasmerio/wasmer/pull/2949) Switch back to using custom LLVM builds on CI
|
||||||
|
- [#2892](https://github.com/wasmerio/wasmer/pull/2892) Renamed `get_native_function` to `get_typed_function`, marked former as deprecated.
|
||||||
|
- [#2976](https://github.com/wasmerio/wasmer/pull/2976) Upgrade enumset minimum version to one that compiles
|
||||||
|
- [#2974](https://github.com/wasmerio/wasmer/pull/2974) Context api tests
|
||||||
|
- [#2973](https://github.com/wasmerio/wasmer/pull/2973) Port C API to new Context API
|
||||||
|
- [#2969](https://github.com/wasmerio/wasmer/pull/2969) Port JS API to new Context API
|
||||||
|
- [#2966](https://github.com/wasmerio/wasmer/pull/2966) Singlepass nopanic #2966
|
||||||
|
- [#2957](https://github.com/wasmerio/wasmer/pull/2957) Enable multi-value handling in Singlepass compiler
|
||||||
|
- [#2954](https://github.com/wasmerio/wasmer/pull/2954) Some fixes to x86_64 Singlepass compiler, when using atomics
|
||||||
|
- [#2953](https://github.com/wasmerio/wasmer/pull/2953) Makefile: add check target
|
||||||
|
- [#2950](https://github.com/wasmerio/wasmer/pull/2950) compiler-cranelift: Fix typo in enum variant
|
||||||
|
- [#2947](https://github.com/wasmerio/wasmer/pull/2947) Converted the WASI js test into a generic stdio test that works for both sys and js versions of wasmer
|
||||||
|
- [#2940](https://github.com/wasmerio/wasmer/pull/2940) Merge wasmer3 back to master branch
|
||||||
|
- [#2939](https://github.com/wasmerio/wasmer/pull/2939) Rename NativeFunc to TypedFunction
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- [#3045](https://github.com/wasmerio/wasmer/pull/3045) Fixed WASI fd_read syscall when reading multiple iovs and read is partial (for #2904)
|
||||||
|
- [#3027](https://github.com/wasmerio/wasmer/pull/3027) Fixed some residual doc issues that prevented make package-docs to build
|
||||||
|
- [#3026](https://github.com/wasmerio/wasmer/pull/3026) test-js.yaml: fix typo
|
||||||
|
- [#3017](https://github.com/wasmerio/wasmer/pull/3017) Fix typo in README.md
|
||||||
|
- [#3001](https://github.com/wasmerio/wasmer/pull/3001) Fix context capi ci errors
|
||||||
|
- [#2997](https://github.com/wasmerio/wasmer/pull/2997) Fix "run --invoke [function]" to behave the same as "run"
|
||||||
- [#2963](https://github.com/wasmerio/wasmer/pull/2963) Remove accidental dependency on libwayland and libxcb in ClI
|
- [#2963](https://github.com/wasmerio/wasmer/pull/2963) Remove accidental dependency on libwayland and libxcb in ClI
|
||||||
- [#2942](https://github.com/wasmerio/wasmer/pull/2942) Fix clippy lints.
|
- [#2942](https://github.com/wasmerio/wasmer/pull/2942) Fix clippy lints.
|
||||||
- [#2943](https://github.com/wasmerio/wasmer/pull/2943) Fix build error on some archs by using c_char instead of i8
|
- [#2943](https://github.com/wasmerio/wasmer/pull/2943) Fix build error on some archs by using c_char instead of i8
|
||||||
- [2976](https://github.com/wasmerio/wasmer/pull/2976) Upgrade minimum enumset to one that compiles
|
- [2976](https://github.com/wasmerio/wasmer/pull/2976) Upgrade minimum enumset to one that compiles
|
||||||
- [2988](https://github.com/wasmerio/wasmer/pull/2988) Have make targets install-capi-lib,install-pkgconfig work without building the wasmer binary
|
- [2988](https://github.com/wasmerio/wasmer/pull/2988) Have make targets install-capi-lib,install-pkgconfig work without building the wasmer binary
|
||||||
|
- [#2967](https://github.com/wasmerio/wasmer/pull/2967) Fix singlepass on arm64 that was trying to emit a sub opcode with a constant as destination (for #2959)
|
||||||
|
- [#2948](https://github.com/wasmerio/wasmer/pull/2948) Fix regression on gen_import_call_trampoline_arm64()
|
||||||
|
- [#2944](https://github.com/wasmerio/wasmer/pull/2944) Fix duplicate entries in the CHANGELOG
|
||||||
|
|
||||||
## 2.3.0 - 2022/06/06
|
## 2.3.0 - 2022/06/06
|
||||||
|
|
||||||
|
|||||||
437
Cargo.lock
generated
437
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
28
Cargo.toml
28
Cargo.toml
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-workspace"
|
name = "wasmer-workspace"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Wasmer workspace"
|
description = "Wasmer workspace"
|
||||||
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||||
repository = "https://github.com/wasmerio/wasmer"
|
repository = "https://github.com/wasmerio/wasmer"
|
||||||
@@ -10,18 +10,18 @@ publish = false
|
|||||||
autoexamples = false
|
autoexamples = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer = { version = "=2.3.0", path = "lib/api", default-features = false }
|
wasmer = { version = "=3.0.0-alpha.4", path = "lib/api", default-features = false }
|
||||||
wasmer-compiler = { version = "=2.3.0", path = "lib/compiler", features = ["compiler"] }
|
wasmer-compiler = { version = "=3.0.0-alpha.4", path = "lib/compiler", features = ["compiler"] }
|
||||||
wasmer-compiler-cranelift = { version = "=2.3.0", path = "lib/compiler-cranelift", optional = true }
|
wasmer-compiler-cranelift = { version = "=3.0.0-alpha.4", path = "lib/compiler-cranelift", optional = true }
|
||||||
wasmer-compiler-singlepass = { version = "=2.3.0", path = "lib/compiler-singlepass", optional = true }
|
wasmer-compiler-singlepass = { version = "=3.0.0-alpha.4", path = "lib/compiler-singlepass", optional = true }
|
||||||
wasmer-compiler-llvm = { version = "=2.3.0", path = "lib/compiler-llvm", optional = true }
|
wasmer-compiler-llvm = { version = "=3.0.0-alpha.4", path = "lib/compiler-llvm", optional = true }
|
||||||
wasmer-emscripten = { version = "=2.3.0", path = "lib/emscripten", optional = true }
|
wasmer-emscripten = { version = "=3.0.0-alpha.4", path = "lib/emscripten", optional = true }
|
||||||
wasmer-wasi = { version = "=2.3.0", path = "lib/wasi", optional = true }
|
wasmer-wasi = { version = "=3.0.0-alpha.4", path = "lib/wasi", optional = true }
|
||||||
wasmer-wast = { version = "=2.3.0", path = "tests/lib/wast", optional = true }
|
wasmer-wast = { version = "=3.0.0-alpha.4", path = "tests/lib/wast", optional = true }
|
||||||
wasi-test-generator = { version = "=2.3.0", path = "tests/wasi-wast", optional = true }
|
wasi-test-generator = { version = "=3.0.0-alpha.4", path = "tests/wasi-wast", optional = true }
|
||||||
wasmer-cache = { version = "=2.3.0", path = "lib/cache", optional = true }
|
wasmer-cache = { version = "=3.0.0-alpha.4", path = "lib/cache", optional = true }
|
||||||
wasmer-types = { version = "=2.3.0", path = "lib/types" }
|
wasmer-types = { version = "=3.0.0-alpha.4", path = "lib/types" }
|
||||||
wasmer-middlewares = { version = "=2.3.0", path = "lib/middlewares", optional = true }
|
wasmer-middlewares = { version = "=3.0.0-alpha.4", path = "lib/middlewares", optional = true }
|
||||||
cfg-if = "1.0"
|
cfg-if = "1.0"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
@@ -64,7 +64,7 @@ glob = "0.3"
|
|||||||
rustc_version = "0.4"
|
rustc_version = "0.4"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
wasmer = { version = "=2.3.0", path = "lib/api", default-features = false, features = ["cranelift"] }
|
wasmer = { version = "=3.0.0-alpha.4", path = "lib/api", default-features = false, features = ["cranelift"] }
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
criterion = "0.3"
|
criterion = "0.3"
|
||||||
lazy_static = "1.4"
|
lazy_static = "1.4"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer"
|
name = "wasmer"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "High-performance WebAssembly runtime"
|
description = "High-performance WebAssembly runtime"
|
||||||
categories = ["wasm"]
|
categories = ["wasm"]
|
||||||
keywords = ["wasm", "webassembly", "runtime", "vm"]
|
keywords = ["wasm", "webassembly", "runtime", "vm"]
|
||||||
@@ -33,15 +33,15 @@ wat = { version = "1.0", optional = true }
|
|||||||
# Dependencies and Development Dependencies for `sys`.
|
# Dependencies and Development Dependencies for `sys`.
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
# - Mandatory dependencies for `sys`.
|
# - Mandatory dependencies for `sys`.
|
||||||
wasmer-vm = { path = "../vm", version = "=2.3.0" }
|
wasmer-vm = { path = "../vm", version = "=3.0.0-alpha.4" }
|
||||||
wasmer-compiler = { path = "../compiler", version = "=2.3.0" }
|
wasmer-compiler = { path = "../compiler", version = "=3.0.0-alpha.4" }
|
||||||
wasmer-derive = { path = "../derive", version = "=2.3.0" }
|
wasmer-derive = { path = "../derive", version = "=3.0.0-alpha.4" }
|
||||||
wasmer-types = { path = "../types", version = "=2.3.0" }
|
wasmer-types = { path = "../types", version = "=3.0.0-alpha.4" }
|
||||||
target-lexicon = { version = "0.12.2", default-features = false }
|
target-lexicon = { version = "0.12.2", default-features = false }
|
||||||
# - Optional dependencies for `sys`.
|
# - Optional dependencies for `sys`.
|
||||||
wasmer-compiler-singlepass = { path = "../compiler-singlepass", version = "=2.3.0", optional = true }
|
wasmer-compiler-singlepass = { path = "../compiler-singlepass", version = "=3.0.0-alpha.4", optional = true }
|
||||||
wasmer-compiler-cranelift = { path = "../compiler-cranelift", version = "=2.3.0", optional = true }
|
wasmer-compiler-cranelift = { path = "../compiler-cranelift", version = "=3.0.0-alpha.4", optional = true }
|
||||||
wasmer-compiler-llvm = { path = "../compiler-llvm", version = "=2.3.0", optional = true }
|
wasmer-compiler-llvm = { path = "../compiler-llvm", version = "=3.0.0-alpha.4", optional = true }
|
||||||
|
|
||||||
wasm-bindgen = { version = "0.2.74", optional = true }
|
wasm-bindgen = { version = "0.2.74", optional = true }
|
||||||
js-sys = { version = "0.3.51", optional = true }
|
js-sys = { version = "0.3.51", optional = true }
|
||||||
@@ -58,11 +58,11 @@ anyhow = "1.0"
|
|||||||
# Dependencies and Develoment Dependencies for `js`.
|
# Dependencies and Develoment Dependencies for `js`.
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
# - Mandatory dependencies for `js`.
|
# - Mandatory dependencies for `js`.
|
||||||
wasmer-types = { path = "../types", version = "=2.3.0", default-features = false, features = ["std"] }
|
wasmer-types = { path = "../types", version = "=3.0.0-alpha.4", default-features = false, features = ["std"] }
|
||||||
wasm-bindgen = "0.2.74"
|
wasm-bindgen = "0.2.74"
|
||||||
js-sys = "0.3.51"
|
js-sys = "0.3.51"
|
||||||
#web-sys = { version = "0.3.51", features = [ "console" ] }
|
#web-sys = { version = "0.3.51", features = [ "console" ] }
|
||||||
wasmer-derive = { path = "../derive", version = "=2.3.0" }
|
wasmer-derive = { path = "../derive", version = "=3.0.0-alpha.4" }
|
||||||
# - Optional dependencies for `js`.
|
# - Optional dependencies for `js`.
|
||||||
wasmparser = { version = "0.83", default-features = false, optional = true }
|
wasmparser = { version = "0.83", default-features = false, optional = true }
|
||||||
hashbrown = { version = "0.11", optional = true }
|
hashbrown = { version = "0.11", optional = true }
|
||||||
|
|||||||
6
lib/api/src/sys/externals/function.rs
vendored
6
lib/api/src/sys/externals/function.rs
vendored
@@ -42,6 +42,7 @@ pub struct Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Function {
|
impl Function {
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Creates a new host `Function` (dynamic) with the provided signature.
|
/// Creates a new host `Function` (dynamic) with the provided signature.
|
||||||
///
|
///
|
||||||
/// If you know the signature of the host function at compile time,
|
/// If you know the signature of the host function at compile time,
|
||||||
@@ -159,6 +160,7 @@ impl Function {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Creates a new host `Function` from a native function.
|
/// Creates a new host `Function` from a native function.
|
||||||
///
|
///
|
||||||
/// The function signature is automatically retrieved using the
|
/// The function signature is automatically retrieved using the
|
||||||
@@ -248,6 +250,7 @@ impl Function {
|
|||||||
.clone()
|
.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
fn call_wasm(
|
fn call_wasm(
|
||||||
&self,
|
&self,
|
||||||
store: &mut impl AsStoreMut,
|
store: &mut impl AsStoreMut,
|
||||||
@@ -365,6 +368,7 @@ impl Function {
|
|||||||
self.ty(store).results().len()
|
self.ty(store).results().len()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Call the `Function` function.
|
/// Call the `Function` function.
|
||||||
///
|
///
|
||||||
/// Depending on where the Function is defined, it will call it.
|
/// Depending on where the Function is defined, it will call it.
|
||||||
@@ -422,6 +426,7 @@ impl Function {
|
|||||||
VMFuncRef(vm_function.anyfunc.as_ptr())
|
VMFuncRef(vm_function.anyfunc.as_ptr())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
pub(crate) unsafe fn from_vm_funcref(store: &mut impl AsStoreMut, funcref: VMFuncRef) -> Self {
|
pub(crate) unsafe fn from_vm_funcref(store: &mut impl AsStoreMut, funcref: VMFuncRef) -> Self {
|
||||||
let signature = store
|
let signature = store
|
||||||
.as_store_ref()
|
.as_store_ref()
|
||||||
@@ -771,6 +776,7 @@ mod inner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
unsafe impl FromToNativeWasmType for Option<Function> {
|
unsafe impl FromToNativeWasmType for Option<Function> {
|
||||||
type Native = Self;
|
type Native = Self;
|
||||||
|
|
||||||
|
|||||||
1
lib/api/src/sys/externals/global.rs
vendored
1
lib/api/src/sys/externals/global.rs
vendored
@@ -95,6 +95,7 @@ impl Global {
|
|||||||
*self.handle.get(store.as_store_ref().objects()).ty()
|
*self.handle.get(store.as_store_ref().objects()).ty()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Retrieves the current value [`Value`] that the Global has.
|
/// Retrieves the current value [`Value`] that the Global has.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
|
|||||||
1
lib/api/src/sys/externals/memory.rs
vendored
1
lib/api/src/sys/externals/memory.rs
vendored
@@ -34,6 +34,7 @@ pub struct Memory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Memory {
|
impl Memory {
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Creates a new host `Memory` from the provided [`MemoryType`].
|
/// Creates a new host `Memory` from the provided [`MemoryType`].
|
||||||
///
|
///
|
||||||
/// This function will construct the `Memory` using the store
|
/// This function will construct the `Memory` using the store
|
||||||
|
|||||||
3
lib/api/src/sys/externals/table.rs
vendored
3
lib/api/src/sys/externals/table.rs
vendored
@@ -46,6 +46,7 @@ fn value_to_table_element(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
fn value_from_table_element(store: &mut impl AsStoreMut, item: wasmer_vm::TableElement) -> Value {
|
fn value_from_table_element(store: &mut impl AsStoreMut, item: wasmer_vm::TableElement) -> Value {
|
||||||
match item {
|
match item {
|
||||||
wasmer_vm::TableElement::FuncRef(funcref) => {
|
wasmer_vm::TableElement::FuncRef(funcref) => {
|
||||||
@@ -58,6 +59,7 @@ fn value_from_table_element(store: &mut impl AsStoreMut, item: wasmer_vm::TableE
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Table {
|
impl Table {
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Creates a new `Table` with the provided [`TableType`] definition.
|
/// Creates a new `Table` with the provided [`TableType`] definition.
|
||||||
///
|
///
|
||||||
/// All the elements in the table will be set to the `init` value.
|
/// All the elements in the table will be set to the `init` value.
|
||||||
@@ -92,6 +94,7 @@ impl Table {
|
|||||||
*self.handle.get(store.as_store_ref().objects()).ty()
|
*self.handle.get(store.as_store_ref().objects()).ty()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Retrieves an element of the table at the provided `index`.
|
/// Retrieves an element of the table at the provided `index`.
|
||||||
pub fn get(&self, store: &mut impl AsStoreMut, index: u32) -> Option<Value> {
|
pub fn get(&self, store: &mut impl AsStoreMut, index: u32) -> Option<Value> {
|
||||||
let item = self.handle.get(store.as_store_ref().objects()).get(index)?;
|
let item = self.handle.get(store.as_store_ref().objects()).get(index)?;
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ impl From<wasmer_compiler::InstantiationError> for InstantiationError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Instance {
|
impl Instance {
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Creates a new `Instance` from a WebAssembly [`Module`] and a
|
/// Creates a new `Instance` from a WebAssembly [`Module`] and a
|
||||||
/// set of imports using [`Imports`] or the [`imports`] macro helper.
|
/// set of imports using [`Imports`] or the [`imports`] macro helper.
|
||||||
///
|
///
|
||||||
@@ -137,6 +138,7 @@ impl Instance {
|
|||||||
Ok(instance)
|
Ok(instance)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Creates a new `Instance` from a WebAssembly [`Module`] and a
|
/// Creates a new `Instance` from a WebAssembly [`Module`] and a
|
||||||
/// vector of imports.
|
/// vector of imports.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ pub struct Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Module {
|
impl Module {
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Creates a new WebAssembly Module given the configuration
|
/// Creates a new WebAssembly Module given the configuration
|
||||||
/// in the store.
|
/// in the store.
|
||||||
///
|
///
|
||||||
@@ -127,6 +128,7 @@ impl Module {
|
|||||||
Self::from_binary(store, bytes.as_ref())
|
Self::from_binary(store, bytes.as_ref())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Creates a new WebAssembly module from a file path.
|
/// Creates a new WebAssembly module from a file path.
|
||||||
pub fn from_file(
|
pub fn from_file(
|
||||||
store: &impl AsStoreRef,
|
store: &impl AsStoreRef,
|
||||||
@@ -143,6 +145,7 @@ impl Module {
|
|||||||
Ok(module)
|
Ok(module)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Creates a new WebAssembly module from a binary.
|
/// Creates a new WebAssembly module from a binary.
|
||||||
///
|
///
|
||||||
/// Opposed to [`Module::new`], this function is not compatible with
|
/// Opposed to [`Module::new`], this function is not compatible with
|
||||||
@@ -153,6 +156,7 @@ impl Module {
|
|||||||
unsafe { Self::from_binary_unchecked(store, binary) }
|
unsafe { Self::from_binary_unchecked(store, binary) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Creates a new WebAssembly module skipping any kind of validation.
|
/// Creates a new WebAssembly module skipping any kind of validation.
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
@@ -168,6 +172,7 @@ impl Module {
|
|||||||
Ok(module)
|
Ok(module)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Validates a new WebAssembly Module given the configuration
|
/// Validates a new WebAssembly Module given the configuration
|
||||||
/// in the Store.
|
/// in the Store.
|
||||||
///
|
///
|
||||||
@@ -178,6 +183,7 @@ impl Module {
|
|||||||
store.as_store_ref().engine().validate(binary)
|
store.as_store_ref().engine().validate(binary)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
fn compile(store: &impl AsStoreRef, binary: &[u8]) -> Result<Self, CompileError> {
|
fn compile(store: &impl AsStoreRef, binary: &[u8]) -> Result<Self, CompileError> {
|
||||||
let artifact = store
|
let artifact = store
|
||||||
.as_store_ref()
|
.as_store_ref()
|
||||||
@@ -222,6 +228,7 @@ impl Module {
|
|||||||
self.artifact.serialize_to_file(path.as_ref())
|
self.artifact.serialize_to_file(path.as_ref())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Deserializes a serialized Module binary into a `Module`.
|
/// Deserializes a serialized Module binary into a `Module`.
|
||||||
/// > Note: the module has to be serialized before with the `serialize` method.
|
/// > Note: the module has to be serialized before with the `serialize` method.
|
||||||
///
|
///
|
||||||
@@ -253,6 +260,7 @@ impl Module {
|
|||||||
Ok(Self::from_artifact(artifact))
|
Ok(Self::from_artifact(artifact))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Deserializes a a serialized Module located in a `Path` into a `Module`.
|
/// Deserializes a a serialized Module located in a `Path` into a `Module`.
|
||||||
/// > Note: the module has to be serialized before with the `serialize` method.
|
/// > Note: the module has to be serialized before with the `serialize` method.
|
||||||
///
|
///
|
||||||
@@ -288,6 +296,7 @@ impl Module {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
pub(crate) fn instantiate(
|
pub(crate) fn instantiate(
|
||||||
&self,
|
&self,
|
||||||
store: &mut impl AsStoreMut,
|
store: &mut impl AsStoreMut,
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ impl NativeWasmType for Function {
|
|||||||
type Abi = usize;
|
type Abi = usize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
impl NativeWasmTypeInto for Option<Function> {
|
impl NativeWasmTypeInto for Option<Function> {
|
||||||
#[inline]
|
#[inline]
|
||||||
unsafe fn from_abi(store: &mut impl AsStoreMut, abi: Self::Abi) -> Self {
|
unsafe fn from_abi(store: &mut impl AsStoreMut, abi: Self::Abi) -> Self {
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ use wasmer_vm::StoreObjects;
|
|||||||
/// wrap the actual context in a box.
|
/// wrap the actual context in a box.
|
||||||
pub(crate) struct StoreInner {
|
pub(crate) struct StoreInner {
|
||||||
pub(crate) objects: StoreObjects,
|
pub(crate) objects: StoreObjects,
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
pub(crate) engine: Engine,
|
pub(crate) engine: Engine,
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
pub(crate) tunables: Box<dyn Tunables + Send + Sync>,
|
pub(crate) tunables: Box<dyn Tunables + Send + Sync>,
|
||||||
pub(crate) trap_handler: Option<Box<TrapHandlerFn<'static>>>,
|
pub(crate) trap_handler: Option<Box<TrapHandlerFn<'static>>>,
|
||||||
}
|
}
|
||||||
@@ -29,6 +31,7 @@ pub(crate) struct StoreInner {
|
|||||||
/// Spec: <https://webassembly.github.io/spec/core/exec/runtime.html#store>
|
/// Spec: <https://webassembly.github.io/spec/core/exec/runtime.html#store>
|
||||||
pub struct Store {
|
pub struct Store {
|
||||||
pub(crate) inner: Box<StoreInner>,
|
pub(crate) inner: Box<StoreInner>,
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
engine: Engine,
|
engine: Engine,
|
||||||
trap_handler: Arc<RwLock<Option<Box<TrapHandlerFn<'static>>>>>,
|
trap_handler: Arc<RwLock<Option<Box<TrapHandlerFn<'static>>>>>,
|
||||||
}
|
}
|
||||||
@@ -42,6 +45,7 @@ impl Store {
|
|||||||
Self::new_with_tunables(engine, BaseTunables::for_target(&target))
|
Self::new_with_tunables(engine, BaseTunables::for_target(&target))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
#[deprecated(
|
#[deprecated(
|
||||||
since = "3.0.0",
|
since = "3.0.0",
|
||||||
note = "Store::new_with_engine has been deprecated in favor of Store::new"
|
note = "Store::new_with_engine has been deprecated in favor of Store::new"
|
||||||
@@ -56,6 +60,7 @@ impl Store {
|
|||||||
self.inner.trap_handler = handler;
|
self.inner.trap_handler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Creates a new `Store` with a specific [`Engine`] and [`Tunables`].
|
/// Creates a new `Store` with a specific [`Engine`] and [`Tunables`].
|
||||||
pub fn new_with_tunables(
|
pub fn new_with_tunables(
|
||||||
engine: impl Into<Engine>,
|
engine: impl Into<Engine>,
|
||||||
@@ -79,16 +84,19 @@ impl Store {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Returns the [`Tunables`].
|
/// Returns the [`Tunables`].
|
||||||
pub fn tunables(&self) -> &dyn Tunables {
|
pub fn tunables(&self) -> &dyn Tunables {
|
||||||
self.inner.tunables.as_ref()
|
self.inner.tunables.as_ref()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Returns the [`Engine`].
|
/// Returns the [`Engine`].
|
||||||
pub fn engine(&self) -> &Engine {
|
pub fn engine(&self) -> &Engine {
|
||||||
&self.engine
|
&self.engine
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Checks whether two stores are identical. A store is considered
|
/// Checks whether two stores are identical. A store is considered
|
||||||
/// equal to another store if both have the same engine. The
|
/// equal to another store if both have the same engine. The
|
||||||
/// tunables are excluded from the logic.
|
/// tunables are excluded from the logic.
|
||||||
@@ -97,6 +105,7 @@ impl Store {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
impl PartialEq for Store {
|
impl PartialEq for Store {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
Self::same(self, other)
|
Self::same(self, other)
|
||||||
@@ -207,16 +216,19 @@ impl<'a> StoreRef<'a> {
|
|||||||
&self.inner.objects
|
&self.inner.objects
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Returns the [`Tunables`].
|
/// Returns the [`Tunables`].
|
||||||
pub fn tunables(&self) -> &dyn Tunables {
|
pub fn tunables(&self) -> &dyn Tunables {
|
||||||
self.inner.tunables.as_ref()
|
self.inner.tunables.as_ref()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Returns the [`Engine`].
|
/// Returns the [`Engine`].
|
||||||
pub fn engine(&self) -> &Engine {
|
pub fn engine(&self) -> &Engine {
|
||||||
&self.inner.engine
|
&self.inner.engine
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Checks whether two stores are identical. A store is considered
|
/// Checks whether two stores are identical. A store is considered
|
||||||
/// equal to another store if both have the same engine. The
|
/// equal to another store if both have the same engine. The
|
||||||
/// tunables are excluded from the logic.
|
/// tunables are excluded from the logic.
|
||||||
@@ -241,15 +253,18 @@ pub struct StoreMut<'a> {
|
|||||||
|
|
||||||
impl<'a> StoreMut<'a> {
|
impl<'a> StoreMut<'a> {
|
||||||
/// Returns the [`Tunables`].
|
/// Returns the [`Tunables`].
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
pub fn tunables(&self) -> &dyn Tunables {
|
pub fn tunables(&self) -> &dyn Tunables {
|
||||||
self.inner.tunables.as_ref()
|
self.inner.tunables.as_ref()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the [`Engine`].
|
/// Returns the [`Engine`].
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
pub fn engine(&self) -> &Engine {
|
pub fn engine(&self) -> &Engine {
|
||||||
&self.inner.engine
|
&self.inner.engine
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Checks whether two stores are identical. A store is considered
|
/// Checks whether two stores are identical. A store is considered
|
||||||
/// equal to another store if both have the same engine. The
|
/// equal to another store if both have the same engine. The
|
||||||
/// tunables are excluded from the logic.
|
/// tunables are excluded from the logic.
|
||||||
@@ -257,6 +272,7 @@ impl<'a> StoreMut<'a> {
|
|||||||
a.inner.engine.id() == b.inner.engine.id()
|
a.inner.engine.id() == b.inner.engine.id()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
pub(crate) fn tunables_and_objects_mut(&mut self) -> (&dyn Tunables, &mut StoreObjects) {
|
pub(crate) fn tunables_and_objects_mut(&mut self) -> (&dyn Tunables, &mut StoreObjects) {
|
||||||
(self.inner.tunables.as_ref(), &mut self.inner.objects)
|
(self.inner.tunables.as_ref(), &mut self.inner.objects)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ impl Value {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
/// Converts a `RawValue` to a `Value`.
|
/// Converts a `RawValue` to a `Value`.
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-c-api"
|
name = "wasmer-c-api"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Wasmer C API library"
|
description = "Wasmer C API library"
|
||||||
categories = ["wasm", "api-bindings"]
|
categories = ["wasm", "api-bindings"]
|
||||||
keywords = ["wasm", "webassembly", "runtime"]
|
keywords = ["wasm", "webassembly", "runtime"]
|
||||||
@@ -22,15 +22,15 @@ crate-type = ["cdylib", "rlib", "staticlib"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
# We rename `wasmer` to `wasmer-api` to avoid the conflict with this
|
# We rename `wasmer` to `wasmer-api` to avoid the conflict with this
|
||||||
# library name (see `[lib]`).
|
# library name (see `[lib]`).
|
||||||
wasmer-api = { version = "=2.3.0", path = "../api", default-features = false, features = ["sys"], package = "wasmer" }
|
wasmer-api = { version = "=3.0.0-alpha.4", path = "../api", default-features = false, features = ["sys"], package = "wasmer" }
|
||||||
wasmer-compiler-cranelift = { version = "=2.3.0", path = "../compiler-cranelift", optional = true }
|
wasmer-compiler-cranelift = { version = "=3.0.0-alpha.4", path = "../compiler-cranelift", optional = true }
|
||||||
wasmer-compiler-singlepass = { version = "=2.3.0", path = "../compiler-singlepass", optional = true }
|
wasmer-compiler-singlepass = { version = "=3.0.0-alpha.4", path = "../compiler-singlepass", optional = true }
|
||||||
wasmer-compiler-llvm = { version = "=2.3.0", path = "../compiler-llvm", optional = true }
|
wasmer-compiler-llvm = { version = "=3.0.0-alpha.4", path = "../compiler-llvm", optional = true }
|
||||||
wasmer-emscripten = { version = "=2.3.0", path = "../emscripten", optional = true }
|
wasmer-emscripten = { version = "=3.0.0-alpha.4", path = "../emscripten", optional = true }
|
||||||
wasmer-compiler = { version = "=2.3.0", path = "../compiler" }
|
wasmer-compiler = { version = "=3.0.0-alpha.4", path = "../compiler" }
|
||||||
wasmer-middlewares = { version = "=2.3.0", path = "../middlewares", optional = true }
|
wasmer-middlewares = { version = "=3.0.0-alpha.4", path = "../middlewares", optional = true }
|
||||||
wasmer-wasi = { version = "=2.3.0", path = "../wasi", default-features = false, features = ["host-fs", "sys"], optional = true }
|
wasmer-wasi = { version = "=3.0.0-alpha.4", path = "../wasi", default-features = false, features = ["host-fs", "sys"], optional = true }
|
||||||
wasmer-types = { version = "=2.3.0", path = "../types" }
|
wasmer-types = { version = "=3.0.0-alpha.4", path = "../types" }
|
||||||
enumset = "1.0.2"
|
enumset = "1.0.2"
|
||||||
cfg-if = "1.0"
|
cfg-if = "1.0"
|
||||||
lazy_static = "1.4"
|
lazy_static = "1.4"
|
||||||
|
|||||||
@@ -56,14 +56,16 @@ macro_rules! map_feature_as_c_define {
|
|||||||
($feature:expr, $c_define:ident, $accumulator:ident) => {
|
($feature:expr, $c_define:ident, $accumulator:ident) => {
|
||||||
#[cfg(feature = $feature)]
|
#[cfg(feature = $feature)]
|
||||||
{
|
{
|
||||||
$accumulator.push_str(&format!(
|
use std::fmt::Write;
|
||||||
|
let _ = write!(
|
||||||
|
$accumulator,
|
||||||
r#"
|
r#"
|
||||||
// The `{feature}` feature has been enabled for this build.
|
// The `{feature}` feature has been enabled for this build.
|
||||||
#define {define}
|
#define {define}
|
||||||
"#,
|
"#,
|
||||||
feature = $feature,
|
feature = $feature,
|
||||||
define = $c_define,
|
define = $c_define,
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -184,7 +186,9 @@ fn build_wasm_c_api_headers(crate_dir: &str, out_dir: &str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn add_wasmer_version(pre_header: &mut String) {
|
fn add_wasmer_version(pre_header: &mut String) {
|
||||||
pre_header.push_str(&format!(
|
use std::fmt::Write;
|
||||||
|
let _ = write!(
|
||||||
|
pre_header,
|
||||||
r#"
|
r#"
|
||||||
// This file corresponds to the following Wasmer version.
|
// This file corresponds to the following Wasmer version.
|
||||||
#define WASMER_VERSION "{full}"
|
#define WASMER_VERSION "{full}"
|
||||||
@@ -198,7 +202,7 @@ fn add_wasmer_version(pre_header: &mut String) {
|
|||||||
minor = env!("CARGO_PKG_VERSION_MINOR"),
|
minor = env!("CARGO_PKG_VERSION_MINOR"),
|
||||||
patch = env!("CARGO_PKG_VERSION_PATCH"),
|
patch = env!("CARGO_PKG_VERSION_PATCH"),
|
||||||
pre = env!("CARGO_PKG_VERSION_PRE"),
|
pre = env!("CARGO_PKG_VERSION_PRE"),
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a fresh new `Builder`, already pre-configured.
|
/// Create a fresh new `Builder`, already pre-configured.
|
||||||
|
|||||||
8
lib/cache/Cargo.toml
vendored
8
lib/cache/Cargo.toml
vendored
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-cache"
|
name = "wasmer-cache"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Cache system for Wasmer WebAssembly runtime"
|
description = "Cache system for Wasmer WebAssembly runtime"
|
||||||
categories = ["wasm", "caching"]
|
categories = ["wasm", "caching"]
|
||||||
keywords = ["wasm", "webassembly", "cache"]
|
keywords = ["wasm", "webassembly", "cache"]
|
||||||
@@ -11,7 +11,7 @@ readme = "README.md"
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer = { path = "../api", version = "=2.3.0", default-features = false, features = ["sys"] }
|
wasmer = { path = "../api", version = "=3.0.0-alpha.4", default-features = false, features = ["sys"] }
|
||||||
hex = "0.4"
|
hex = "0.4"
|
||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
blake3 = "1.0"
|
blake3 = "1.0"
|
||||||
@@ -20,9 +20,9 @@ blake3 = "1.0"
|
|||||||
criterion = "0.3"
|
criterion = "0.3"
|
||||||
tempfile = "3"
|
tempfile = "3"
|
||||||
rand = "0.8.3"
|
rand = "0.8.3"
|
||||||
wasmer-compiler-singlepass = { path = "../compiler-singlepass", version = "=2.3.0" }
|
wasmer-compiler-singlepass = { path = "../compiler-singlepass", version = "=3.0.0-alpha.4" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["wasmer/js-serializable-module", "filesystem"]
|
default = ["wasmer/js-serializable-module", "wasmer/compiler", "filesystem"]
|
||||||
filesystem = []
|
filesystem = []
|
||||||
blake3-pure = ["blake3/pure"]
|
blake3-pure = ["blake3/pure"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-compiler-cli"
|
name = "wasmer-compiler-cli"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Wasmer Compiler CLI"
|
description = "Wasmer Compiler CLI"
|
||||||
categories = ["wasm", "command-line-interface"]
|
categories = ["wasm", "command-line-interface"]
|
||||||
keywords = ["wasm", "webassembly", "cli"]
|
keywords = ["wasm", "webassembly", "cli"]
|
||||||
@@ -18,8 +18,8 @@ path = "src/bin/wasmer_compiler.rs"
|
|||||||
doc = false
|
doc = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer-compiler = { version = "=2.3.0", path = "../compiler", features = ["compiler"] }
|
wasmer-compiler = { version = "=3.0.0-alpha.4", path = "../compiler", features = ["compiler"] }
|
||||||
wasmer-types = { version = "=2.3.0", path = "../types" }
|
wasmer-types = { version = "=3.0.0-alpha.4", path = "../types" }
|
||||||
atty = "0.2"
|
atty = "0.2"
|
||||||
colored = "2.0"
|
colored = "2.0"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
@@ -35,12 +35,12 @@ log = { version = "0.4", optional = true }
|
|||||||
tempfile = "3"
|
tempfile = "3"
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
wasmer-compiler-singlepass = { version = "=2.3.0", path = "../compiler-singlepass", optional = true }
|
wasmer-compiler-singlepass = { version = "=3.0.0-alpha.4", path = "../compiler-singlepass", optional = true }
|
||||||
wasmer-compiler-cranelift = { version = "=2.3.0", path = "../compiler-cranelift", optional = true }
|
wasmer-compiler-cranelift = { version = "=3.0.0-alpha.4", path = "../compiler-cranelift", optional = true }
|
||||||
|
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
wasmer-compiler-singlepass = { version = "=2.3.0", path = "../compiler-singlepass", optional = true, default-features = false, features = ["wasm"] }
|
wasmer-compiler-singlepass = { version = "=3.0.0-alpha.4", path = "../compiler-singlepass", optional = true, default-features = false, features = ["wasm"] }
|
||||||
wasmer-compiler-cranelift = { version = "=2.3.0", path = "../compiler-cranelift", optional = true, default-features = false, features = ["wasm"] }
|
wasmer-compiler-cranelift = { version = "=3.0.0-alpha.4", path = "../compiler-cranelift", optional = true, default-features = false, features = ["wasm"] }
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
unix_mode = "0.1.3"
|
unix_mode = "0.1.3"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-cli"
|
name = "wasmer-cli"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Wasmer CLI"
|
description = "Wasmer CLI"
|
||||||
categories = ["wasm", "command-line-interface"]
|
categories = ["wasm", "command-line-interface"]
|
||||||
keywords = ["wasm", "webassembly", "cli"]
|
keywords = ["wasm", "webassembly", "cli"]
|
||||||
@@ -25,20 +25,20 @@ doc = false
|
|||||||
required-features = ["headless"]
|
required-features = ["headless"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer = { version = "=2.3.0", path = "../api", default-features = false }
|
wasmer = { version = "=3.0.0-alpha.4", path = "../api", default-features = false }
|
||||||
wasmer-compiler = { version = "=2.3.0", path = "../compiler", features = ["compiler", ] }
|
wasmer-compiler = { version = "=3.0.0-alpha.4", path = "../compiler", features = ["compiler", ] }
|
||||||
wasmer-compiler-cranelift = { version = "=2.3.0", path = "../compiler-cranelift", optional = true }
|
wasmer-compiler-cranelift = { version = "=3.0.0-alpha.4", path = "../compiler-cranelift", optional = true }
|
||||||
wasmer-compiler-singlepass = { version = "=2.3.0", path = "../compiler-singlepass", optional = true }
|
wasmer-compiler-singlepass = { version = "=3.0.0-alpha.4", path = "../compiler-singlepass", optional = true }
|
||||||
wasmer-compiler-llvm = { version = "=2.3.0", path = "../compiler-llvm", optional = true }
|
wasmer-compiler-llvm = { version = "=3.0.0-alpha.4", path = "../compiler-llvm", optional = true }
|
||||||
wasmer-emscripten = { version = "=2.3.0", path = "../emscripten", optional = true }
|
wasmer-emscripten = { version = "=3.0.0-alpha.4", path = "../emscripten", optional = true }
|
||||||
wasmer-vm = { version = "=2.3.0", path = "../vm" }
|
wasmer-vm = { version = "=3.0.0-alpha.4", path = "../vm" }
|
||||||
wasmer-wasi = { version = "=2.3.0", path = "../wasi", optional = true }
|
wasmer-wasi = { version = "=3.0.0-alpha.4", path = "../wasi", optional = true }
|
||||||
wasmer-wasi-experimental-io-devices = { version = "=2.3.0", path = "../wasi-experimental-io-devices", optional = true, features = ["link_external_libs"] }
|
wasmer-wasi-experimental-io-devices = { version = "=3.0.0-alpha.4", path = "../wasi-experimental-io-devices", optional = true, features = ["link_external_libs"] }
|
||||||
wasmer-wast = { version = "=2.3.0", path = "../../tests/lib/wast", optional = true }
|
wasmer-wast = { version = "=3.0.0-alpha.4", path = "../../tests/lib/wast", optional = true }
|
||||||
wasmer-cache = { version = "=2.3.0", path = "../cache", optional = true }
|
wasmer-cache = { version = "=3.0.0-alpha.4", path = "../cache", optional = true }
|
||||||
wasmer-types = { version = "=2.3.0", path = "../types" }
|
wasmer-types = { version = "=3.0.0-alpha.4", path = "../types" }
|
||||||
wasmer-vfs = { version = "=2.3.0", path = "../vfs", default-features = false, features = ["host-fs"] }
|
wasmer-object = { version = "=3.0.0-alpha.4", path = "../object" }
|
||||||
wasmer-object = { version = "=2.3.0", path = "../object" }
|
wasmer-vfs = { version = "=3.0.0-alpha.4", path = "../vfs", default-features = false, features = ["host-fs"] }
|
||||||
atty = "0.2"
|
atty = "0.2"
|
||||||
colored = "2.0"
|
colored = "2.0"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-compiler-cranelift"
|
name = "wasmer-compiler-cranelift"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Cranelift compiler for Wasmer WebAssembly runtime"
|
description = "Cranelift compiler for Wasmer WebAssembly runtime"
|
||||||
categories = ["wasm"]
|
categories = ["wasm"]
|
||||||
keywords = ["wasm", "webassembly", "compiler", "cranelift"]
|
keywords = ["wasm", "webassembly", "compiler", "cranelift"]
|
||||||
@@ -12,8 +12,8 @@ readme = "README.md"
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer-compiler = { path = "../compiler", version = "=2.3.0", features = ["translator", "compiler"], default-features = false }
|
wasmer-compiler = { path = "../compiler", version = "=3.0.0-alpha.4", features = ["translator", "compiler"], default-features = false }
|
||||||
wasmer-types = { path = "../types", version = "=2.3.0", default-features = false, features = ["std"] }
|
wasmer-types = { path = "../types", version = "=3.0.0-alpha.4", default-features = false, features = ["std"] }
|
||||||
cranelift-entity = { version = "0.86.1", default-features = false }
|
cranelift-entity = { version = "0.86.1", default-features = false }
|
||||||
cranelift-codegen = { version = "0.86.1", default-features = false, features = ["x86", "arm64"] }
|
cranelift-codegen = { version = "0.86.1", default-features = false, features = ["x86", "arm64"] }
|
||||||
cranelift-frontend = { version = "0.86.1", default-features = false }
|
cranelift-frontend = { version = "0.86.1", default-features = false }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-compiler-llvm"
|
name = "wasmer-compiler-llvm"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "LLVM compiler for Wasmer WebAssembly runtime"
|
description = "LLVM compiler for Wasmer WebAssembly runtime"
|
||||||
categories = ["wasm"]
|
categories = ["wasm"]
|
||||||
keywords = ["wasm", "webassembly", "compiler", "llvm"]
|
keywords = ["wasm", "webassembly", "compiler", "llvm"]
|
||||||
@@ -12,11 +12,11 @@ readme = "README.md"
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer-compiler = { path = "../compiler", version = "=2.3.0", features = [
|
wasmer-compiler = { path = "../compiler", version = "=3.0.0-alpha.4", features = [
|
||||||
"translator", "compiler"
|
"translator", "compiler"
|
||||||
] }
|
] }
|
||||||
wasmer-vm = { path = "../vm", version = "=2.3.0" }
|
wasmer-vm = { path = "../vm", version = "=3.0.0-alpha.4" }
|
||||||
wasmer-types = { path = "../types", version = "=2.3.0" }
|
wasmer-types = { path = "../types", version = "=3.0.0-alpha.4" }
|
||||||
target-lexicon = { version = "0.12.2", default-features = false }
|
target-lexicon = { version = "0.12.2", default-features = false }
|
||||||
smallvec = "1.6"
|
smallvec = "1.6"
|
||||||
object = { version = "0.28.3", default-features = false, features = ["read"] }
|
object = { version = "0.28.3", default-features = false, features = ["read"] }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-compiler-singlepass"
|
name = "wasmer-compiler-singlepass"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Singlepass compiler for Wasmer WebAssembly runtime"
|
description = "Singlepass compiler for Wasmer WebAssembly runtime"
|
||||||
categories = ["wasm"]
|
categories = ["wasm"]
|
||||||
keywords = ["wasm", "webassembly", "compiler", "singlepass"]
|
keywords = ["wasm", "webassembly", "compiler", "singlepass"]
|
||||||
@@ -12,8 +12,8 @@ readme = "README.md"
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer-compiler = { path = "../compiler", version = "=2.3.0", features = ["translator", "compiler"], default-features = false }
|
wasmer-compiler = { path = "../compiler", version = "=3.0.0-alpha.4", features = ["translator", "compiler"], default-features = false }
|
||||||
wasmer-types = { path = "../types", version = "=2.3.0", default-features = false, features = ["std"] }
|
wasmer-types = { path = "../types", version = "=3.0.0-alpha.4", default-features = false, features = ["std"] }
|
||||||
hashbrown = { version = "0.11", optional = true }
|
hashbrown = { version = "0.11", optional = true }
|
||||||
gimli = { version = "0.26", optional = true }
|
gimli = { version = "0.26", optional = true }
|
||||||
more-asserts = "0.2"
|
more-asserts = "0.2"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-compiler"
|
name = "wasmer-compiler"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Base compiler abstraction for Wasmer WebAssembly runtime"
|
description = "Base compiler abstraction for Wasmer WebAssembly runtime"
|
||||||
categories = ["wasm", "no-std"]
|
categories = ["wasm", "no-std"]
|
||||||
keywords = ["wasm", "webassembly", "compiler"]
|
keywords = ["wasm", "webassembly", "compiler"]
|
||||||
@@ -11,7 +11,7 @@ readme = "README.md"
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer-types = { path = "../types", version = "=2.3.0", default-features = false }
|
wasmer-types = { path = "../types", version = "=3.0.0-alpha.4", default-features = false }
|
||||||
wasmparser = { version = "0.83", optional = true, default-features = false }
|
wasmparser = { version = "0.83", optional = true, default-features = false }
|
||||||
enumset = "1.0.2"
|
enumset = "1.0.2"
|
||||||
hashbrown = { version = "0.11", optional = true }
|
hashbrown = { version = "0.11", optional = true }
|
||||||
@@ -31,7 +31,7 @@ leb128 = "0.2"
|
|||||||
enum-iterator = "0.7.0"
|
enum-iterator = "0.7.0"
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
wasmer-vm = { path = "../vm", version = "=2.3.0" }
|
wasmer-vm = { path = "../vm", version = "=3.0.0-alpha.4" }
|
||||||
region = { version = "3.0" }
|
region = { version = "3.0" }
|
||||||
|
|
||||||
[target.'cfg(target_os = "windows")'.dependencies]
|
[target.'cfg(target_os = "windows")'.dependencies]
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#[cfg(feature = "compiler")]
|
#[cfg(feature = "compiler")]
|
||||||
use super::trampoline::{libcall_trampoline_len, make_libcall_trampolines};
|
use super::trampoline::{libcall_trampoline_len, make_libcall_trampolines};
|
||||||
use crate::ArtifactCreate;
|
use crate::ArtifactCreate;
|
||||||
#[cfg(feature = "compiler")]
|
|
||||||
use crate::EngineInner;
|
use crate::EngineInner;
|
||||||
use crate::Features;
|
use crate::Features;
|
||||||
use crate::{ModuleEnvironment, ModuleMiddlewareChain};
|
use crate::{ModuleEnvironment, ModuleMiddlewareChain};
|
||||||
|
|||||||
@@ -76,7 +76,9 @@ impl Engine {
|
|||||||
pub fn headless() -> Self {
|
pub fn headless() -> Self {
|
||||||
Self {
|
Self {
|
||||||
inner: Arc::new(Mutex::new(EngineInner {
|
inner: Arc::new(Mutex::new(EngineInner {
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
compiler: None,
|
compiler: None,
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
features: Features::default(),
|
features: Features::default(),
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
code_memory: vec![],
|
code_memory: vec![],
|
||||||
@@ -118,6 +120,7 @@ impl Engine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Validates a WebAssembly module
|
/// Validates a WebAssembly module
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
pub fn validate(&self, binary: &[u8]) -> Result<(), CompileError> {
|
pub fn validate(&self, binary: &[u8]) -> Result<(), CompileError> {
|
||||||
self.inner().validate(binary)
|
self.inner().validate(binary)
|
||||||
}
|
}
|
||||||
@@ -217,12 +220,14 @@ impl EngineInner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Validate the module
|
/// Validate the module
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
pub fn validate(&self, data: &[u8]) -> Result<(), CompileError> {
|
pub fn validate(&self, data: &[u8]) -> Result<(), CompileError> {
|
||||||
let compiler = self.compiler()?;
|
let compiler = self.compiler()?;
|
||||||
compiler.validate_module(&self.features, data)
|
compiler.validate_module(&self.features, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The Wasm features
|
/// The Wasm features
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
pub fn features(&self) -> &Features {
|
pub fn features(&self) -> &Features {
|
||||||
&self.features
|
&self.features
|
||||||
}
|
}
|
||||||
@@ -348,6 +353,7 @@ impl EngineInner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "compiler")]
|
||||||
impl From<Box<dyn CompilerConfig>> for Engine {
|
impl From<Box<dyn CompilerConfig>> for Engine {
|
||||||
fn from(config: Box<dyn CompilerConfig>) -> Self {
|
fn from(config: Box<dyn CompilerConfig>) -> Self {
|
||||||
EngineBuilder::new(config).engine()
|
EngineBuilder::new(config).engine()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-derive"
|
name = "wasmer-derive"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Wasmer derive macros"
|
description = "Wasmer derive macros"
|
||||||
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||||
repository = "https://github.com/wasmerio/wasmer"
|
repository = "https://github.com/wasmerio/wasmer"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-emscripten"
|
name = "wasmer-emscripten"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Emscripten implementation library for Wasmer WebAssembly runtime"
|
description = "Emscripten implementation library for Wasmer WebAssembly runtime"
|
||||||
categories = ["wasm", "os"]
|
categories = ["wasm", "os"]
|
||||||
keywords = ["wasm", "webassembly", "abi", "emscripten", "posix"]
|
keywords = ["wasm", "webassembly", "abi", "emscripten", "posix"]
|
||||||
@@ -16,8 +16,8 @@ lazy_static = "1.4"
|
|||||||
libc = "^0.2"
|
libc = "^0.2"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
time = { version = "0.2", features = ["std"] }
|
time = { version = "0.2", features = ["std"] }
|
||||||
wasmer = { path = "../api", version = "=2.3.0", default-features = false, features = ["sys", "compiler"] }
|
wasmer = { path = "../api", version = "=3.0.0-alpha.4", default-features = false, features = ["sys", "compiler"] }
|
||||||
wasmer-types = { path = "../types", version = "=2.3.0" }
|
wasmer-types = { path = "../types", version = "=3.0.0-alpha.4" }
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
getrandom = "0.2"
|
getrandom = "0.2"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-middlewares"
|
name = "wasmer-middlewares"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||||
description = "A collection of various useful middlewares"
|
description = "A collection of various useful middlewares"
|
||||||
license = "MIT OR Apache-2.0 WITH LLVM-exception"
|
license = "MIT OR Apache-2.0 WITH LLVM-exception"
|
||||||
@@ -11,12 +11,12 @@ readme = "README.md"
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer = { path = "../api", version = "=2.3.0", default-features = false, features = ["compiler"] }
|
wasmer = { path = "../api", version = "=3.0.0-alpha.4", default-features = false, features = ["compiler"] }
|
||||||
wasmer-types = { path = "../types", version = "=2.3.0" }
|
wasmer-types = { path = "../types", version = "=3.0.0-alpha.4" }
|
||||||
wasmer-vm = { path = "../vm", version = "=2.3.0" }
|
wasmer-vm = { path = "../vm", version = "=3.0.0-alpha.4" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
wasmer = { path = "../api", version = "=2.3.0", features = ["compiler"] }
|
wasmer = { path = "../api", version = "=3.0.0-alpha.4", features = ["compiler"] }
|
||||||
|
|
||||||
[badges]
|
[badges]
|
||||||
maintenance = { status = "actively-developed" }
|
maintenance = { status = "actively-developed" }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-object"
|
name = "wasmer-object"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Wasmer Native Object generator"
|
description = "Wasmer Native Object generator"
|
||||||
categories = ["wasm"]
|
categories = ["wasm"]
|
||||||
keywords = ["wasm", "webassembly"]
|
keywords = ["wasm", "webassembly"]
|
||||||
@@ -11,8 +11,8 @@ readme = "README.md"
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer-types = { path = "../types", version = "=2.3.0" }
|
wasmer-types = { path = "../types", version = "=3.0.0-alpha.4" }
|
||||||
wasmer-compiler = { path = "../compiler", version = "=2.3.0", default-features = false, features = [
|
wasmer-compiler = { path = "../compiler", version = "=3.0.0-alpha.4", default-features = false, features = [
|
||||||
"std",
|
"std",
|
||||||
"translator",
|
"translator",
|
||||||
] }
|
] }
|
||||||
|
|||||||
@@ -24,4 +24,4 @@ mod module;
|
|||||||
|
|
||||||
pub use crate::error::ObjectError;
|
pub use crate::error::ObjectError;
|
||||||
pub use crate::module::{emit_compilation, emit_data, emit_serialized, get_object_for_target};
|
pub use crate::module::{emit_compilation, emit_data, emit_serialized, get_object_for_target};
|
||||||
pub use object::{self, Object};
|
pub use object::{self, write::Object};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-types"
|
name = "wasmer-types"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Wasmer Common Types"
|
description = "Wasmer Common Types"
|
||||||
categories = ["wasm", "no-std", "data-structures"]
|
categories = ["wasm", "no-std", "data-structures"]
|
||||||
keywords = ["wasm", "webassembly", "types"]
|
keywords = ["wasm", "webassembly", "types"]
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The only error that can happen when converting `Bytes` to `Pages`
|
/// The only error that can happen when converting `Bytes` to `Pages`
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Error)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
|
||||||
#[error("Number of pages exceeds uint32 range")]
|
#[error("Number of pages exceeds uint32 range")]
|
||||||
pub struct PageCountOutOfRange;
|
pub struct PageCountOutOfRange;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-vbus"
|
name = "wasmer-vbus"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Wasmer Virtual Bus"
|
description = "Wasmer Virtual Bus"
|
||||||
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
@@ -13,7 +13,9 @@ tracing = { version = "0.1" }
|
|||||||
typetag = { version = "0.1", optional = true }
|
typetag = { version = "0.1", optional = true }
|
||||||
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
|
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
|
||||||
slab = { version = "0.4", optional = true }
|
slab = { version = "0.4", optional = true }
|
||||||
wasmer-vfs = { path = "../vfs", version = "=2.3.0", default-features = false }
|
wasmer-vfs = { path = "../vfs", version = "=3.0.0-alpha.4", default-features = false }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = ["mem_fs"]
|
||||||
|
mem_fs = ["wasmer-vfs/mem-fs"]
|
||||||
|
host_fs = ["wasmer-vfs/host-fs"]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-vfs"
|
name = "wasmer-vfs"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Wasmer Virtual FileSystem"
|
description = "Wasmer Virtual FileSystem"
|
||||||
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -51,12 +51,11 @@ impl VirtualFile for FileHandle {
|
|||||||
_ => return 0,
|
_ => return 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
let node = match fs.storage.get(self.inode) {
|
let inode = fs.storage.get(self.inode);
|
||||||
Some(node) => node,
|
match inode {
|
||||||
_ => return 0,
|
Some(node) => node.metadata().accessed,
|
||||||
};
|
_ => 0,
|
||||||
|
}
|
||||||
node.metadata().accessed
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn last_modified(&self) -> u64 {
|
fn last_modified(&self) -> u64 {
|
||||||
@@ -65,12 +64,11 @@ impl VirtualFile for FileHandle {
|
|||||||
_ => return 0,
|
_ => return 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
let node = match fs.storage.get(self.inode) {
|
let inode = fs.storage.get(self.inode);
|
||||||
Some(node) => node,
|
match inode {
|
||||||
_ => return 0,
|
Some(node) => node.metadata().modified,
|
||||||
};
|
_ => 0,
|
||||||
|
}
|
||||||
node.metadata().modified
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn created_time(&self) -> u64 {
|
fn created_time(&self) -> u64 {
|
||||||
@@ -79,7 +77,8 @@ impl VirtualFile for FileHandle {
|
|||||||
_ => return 0,
|
_ => return 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
let node = match fs.storage.get(self.inode) {
|
let inode = fs.storage.get(self.inode);
|
||||||
|
let node = match inode {
|
||||||
Some(node) => node,
|
Some(node) => node,
|
||||||
_ => return 0,
|
_ => return 0,
|
||||||
};
|
};
|
||||||
@@ -93,7 +92,8 @@ impl VirtualFile for FileHandle {
|
|||||||
_ => return 0,
|
_ => return 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
match fs.storage.get(self.inode) {
|
let inode = fs.storage.get(self.inode);
|
||||||
|
match inode {
|
||||||
Some(Node::File { file, .. }) => file.len().try_into().unwrap_or(0),
|
Some(Node::File { file, .. }) => file.len().try_into().unwrap_or(0),
|
||||||
_ => 0,
|
_ => 0,
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,8 @@ impl VirtualFile for FileHandle {
|
|||||||
.try_write()
|
.try_write()
|
||||||
.map_err(|_| FsError::Lock)?;
|
.map_err(|_| FsError::Lock)?;
|
||||||
|
|
||||||
match fs.storage.get_mut(self.inode) {
|
let inode = fs.storage.get_mut(self.inode);
|
||||||
|
match inode {
|
||||||
Some(Node::File { file, metadata, .. }) => {
|
Some(Node::File { file, metadata, .. }) => {
|
||||||
file.buffer
|
file.buffer
|
||||||
.resize(new_size.try_into().map_err(|_| FsError::UnknownError)?, 0);
|
.resize(new_size.try_into().map_err(|_| FsError::UnknownError)?, 0);
|
||||||
@@ -178,7 +179,8 @@ impl VirtualFile for FileHandle {
|
|||||||
.try_read()
|
.try_read()
|
||||||
.map_err(|_| FsError::Lock)?;
|
.map_err(|_| FsError::Lock)?;
|
||||||
|
|
||||||
match fs.storage.get(self.inode) {
|
let inode = fs.storage.get(self.inode);
|
||||||
|
match inode {
|
||||||
Some(Node::File { file, .. }) => Ok(file.buffer.len() - file.cursor),
|
Some(Node::File { file, .. }) => Ok(file.buffer.len() - file.cursor),
|
||||||
_ => Err(FsError::NotAFile),
|
_ => Err(FsError::NotAFile),
|
||||||
}
|
}
|
||||||
@@ -416,7 +418,8 @@ impl Read for FileHandle {
|
|||||||
io::Error::new(io::ErrorKind::Other, "failed to acquire a write lock")
|
io::Error::new(io::ErrorKind::Other, "failed to acquire a write lock")
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let file = match fs.storage.get_mut(self.inode) {
|
let inode = fs.storage.get_mut(self.inode);
|
||||||
|
let file = match inode {
|
||||||
Some(Node::File { file, .. }) => file,
|
Some(Node::File { file, .. }) => file,
|
||||||
_ => {
|
_ => {
|
||||||
return Err(io::Error::new(
|
return Err(io::Error::new(
|
||||||
@@ -445,7 +448,8 @@ impl Read for FileHandle {
|
|||||||
io::Error::new(io::ErrorKind::Other, "failed to acquire a write lock")
|
io::Error::new(io::ErrorKind::Other, "failed to acquire a write lock")
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let file = match fs.storage.get_mut(self.inode) {
|
let inode = fs.storage.get_mut(self.inode);
|
||||||
|
let file = match inode {
|
||||||
Some(Node::File { file, .. }) => file,
|
Some(Node::File { file, .. }) => file,
|
||||||
_ => {
|
_ => {
|
||||||
return Err(io::Error::new(
|
return Err(io::Error::new(
|
||||||
@@ -493,7 +497,8 @@ impl Read for FileHandle {
|
|||||||
io::Error::new(io::ErrorKind::Other, "failed to acquire a write lock")
|
io::Error::new(io::ErrorKind::Other, "failed to acquire a write lock")
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let file = match fs.storage.get_mut(self.inode) {
|
let inode = fs.storage.get_mut(self.inode);
|
||||||
|
let file = match inode {
|
||||||
Some(Node::File { file, .. }) => file,
|
Some(Node::File { file, .. }) => file,
|
||||||
_ => {
|
_ => {
|
||||||
return Err(io::Error::new(
|
return Err(io::Error::new(
|
||||||
@@ -532,7 +537,8 @@ impl Seek for FileHandle {
|
|||||||
io::Error::new(io::ErrorKind::Other, "failed to acquire a write lock")
|
io::Error::new(io::ErrorKind::Other, "failed to acquire a write lock")
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let file = match fs.storage.get_mut(self.inode) {
|
let inode = fs.storage.get_mut(self.inode);
|
||||||
|
let file = match inode {
|
||||||
Some(Node::File { file, .. }) => file,
|
Some(Node::File { file, .. }) => file,
|
||||||
_ => {
|
_ => {
|
||||||
return Err(io::Error::new(
|
return Err(io::Error::new(
|
||||||
@@ -563,7 +569,8 @@ impl Write for FileHandle {
|
|||||||
io::Error::new(io::ErrorKind::Other, "failed to acquire a write lock")
|
io::Error::new(io::ErrorKind::Other, "failed to acquire a write lock")
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let (file, metadata) = match fs.storage.get_mut(self.inode) {
|
let inode = fs.storage.get_mut(self.inode);
|
||||||
|
let (file, metadata) = match inode {
|
||||||
Some(Node::File { file, metadata, .. }) => (file, metadata),
|
Some(Node::File { file, metadata, .. }) => (file, metadata),
|
||||||
_ => {
|
_ => {
|
||||||
return Err(io::Error::new(
|
return Err(io::Error::new(
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ impl crate::FileOpener for FileOpener {
|
|||||||
|
|
||||||
// Find the inode of the file if it exists.
|
// Find the inode of the file if it exists.
|
||||||
let maybe_inode_of_file = fs
|
let maybe_inode_of_file = fs
|
||||||
.from_parent_get_position_and_inode_of_file(inode_of_parent, &name_of_file)?
|
.as_parent_get_position_and_inode_of_file(inode_of_parent, &name_of_file)?
|
||||||
.map(|(_nth, inode)| inode);
|
.map(|(_nth, inode)| inode);
|
||||||
|
|
||||||
(inode_of_parent, maybe_inode_of_file, name_of_file)
|
(inode_of_parent, maybe_inode_of_file, name_of_file)
|
||||||
@@ -81,7 +81,8 @@ impl crate::FileOpener for FileOpener {
|
|||||||
.try_write()
|
.try_write()
|
||||||
.map_err(|_| FsError::Lock)?;
|
.map_err(|_| FsError::Lock)?;
|
||||||
|
|
||||||
match fs.storage.get_mut(inode_of_file) {
|
let inode = fs.storage.get_mut(inode_of_file);
|
||||||
|
match inode {
|
||||||
Some(Node::File { metadata, file, .. }) => {
|
Some(Node::File { metadata, file, .. }) => {
|
||||||
// Update the accessed time.
|
// Update the accessed time.
|
||||||
metadata.accessed = time();
|
metadata.accessed = time();
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ impl crate::FileSystem for FileSystem {
|
|||||||
let (path, inode_of_directory) = fs.canonicalize(path)?;
|
let (path, inode_of_directory) = fs.canonicalize(path)?;
|
||||||
|
|
||||||
// Check it's a directory and fetch the immediate children as `DirEntry`.
|
// Check it's a directory and fetch the immediate children as `DirEntry`.
|
||||||
let children = match fs.storage.get(inode_of_directory) {
|
let inode = fs.storage.get(inode_of_directory);
|
||||||
|
let children = match inode {
|
||||||
Some(Node::Directory { children, .. }) => children
|
Some(Node::Directory { children, .. }) => children
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|inode| fs.storage.get(*inode))
|
.filter_map(|inode| fs.storage.get(*inode))
|
||||||
@@ -133,12 +134,11 @@ impl crate::FileSystem for FileSystem {
|
|||||||
|
|
||||||
// Get the child index to remove in the parent node, in
|
// Get the child index to remove in the parent node, in
|
||||||
// addition to the inode of the directory to remove.
|
// addition to the inode of the directory to remove.
|
||||||
let (position, inode_of_directory) = fs
|
let (position, inode_of_directory) = fs.as_parent_get_position_and_inode_of_directory(
|
||||||
.from_parent_get_position_and_inode_of_directory(
|
inode_of_parent,
|
||||||
inode_of_parent,
|
&name_of_directory,
|
||||||
&name_of_directory,
|
DirectoryMustBeEmpty::Yes,
|
||||||
DirectoryMustBeEmpty::Yes,
|
)?;
|
||||||
)?;
|
|
||||||
|
|
||||||
(inode_of_parent, position, inode_of_directory)
|
(inode_of_parent, position, inode_of_directory)
|
||||||
};
|
};
|
||||||
@@ -183,7 +183,7 @@ impl crate::FileSystem for FileSystem {
|
|||||||
// Get the child indexes to update in the parent nodes, in
|
// Get the child indexes to update in the parent nodes, in
|
||||||
// addition to the inode of the directory to update.
|
// addition to the inode of the directory to update.
|
||||||
let (position_of_from, inode) = fs
|
let (position_of_from, inode) = fs
|
||||||
.from_parent_get_position_and_inode(inode_of_from_parent, &name_of_from)?
|
.as_parent_get_position_and_inode(inode_of_from_parent, &name_of_from)?
|
||||||
.ok_or(FsError::NotAFile)?;
|
.ok_or(FsError::NotAFile)?;
|
||||||
|
|
||||||
(
|
(
|
||||||
@@ -211,7 +211,8 @@ impl crate::FileSystem for FileSystem {
|
|||||||
}
|
}
|
||||||
// Otherwise, we need to at least update the modified time of the parent.
|
// Otherwise, we need to at least update the modified time of the parent.
|
||||||
else {
|
else {
|
||||||
match fs.storage.get_mut(inode_of_from_parent) {
|
let inode = fs.storage.get_mut(inode_of_from_parent);
|
||||||
|
match inode {
|
||||||
Some(Node::Directory {
|
Some(Node::Directory {
|
||||||
metadata: Metadata { modified, .. },
|
metadata: Metadata { modified, .. },
|
||||||
..
|
..
|
||||||
@@ -258,7 +259,7 @@ impl crate::FileSystem for FileSystem {
|
|||||||
|
|
||||||
// Find the inode of the file if it exists, along with its position.
|
// Find the inode of the file if it exists, along with its position.
|
||||||
let maybe_position_and_inode_of_file =
|
let maybe_position_and_inode_of_file =
|
||||||
fs.from_parent_get_position_and_inode_of_file(inode_of_parent, &name_of_file)?;
|
fs.as_parent_get_position_and_inode_of_file(inode_of_parent, &name_of_file)?;
|
||||||
|
|
||||||
match maybe_position_and_inode_of_file {
|
match maybe_position_and_inode_of_file {
|
||||||
Some((position, inode_of_file)) => (inode_of_parent, position, inode_of_file),
|
Some((position, inode_of_file)) => (inode_of_parent, position, inode_of_file),
|
||||||
@@ -318,13 +319,7 @@ impl FileSystemInner {
|
|||||||
Node::Directory { children, .. } => children
|
Node::Directory { children, .. } => children
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|inode| self.storage.get(*inode))
|
.filter_map(|inode| self.storage.get(*inode))
|
||||||
.find_map(|node| {
|
.find(|node| node.name() == component.as_os_str())
|
||||||
if node.name() == component.as_os_str() {
|
|
||||||
Some(node)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.ok_or(FsError::NotAFile)?,
|
.ok_or(FsError::NotAFile)?,
|
||||||
_ => return Err(FsError::BaseNotDirectory),
|
_ => return Err(FsError::BaseNotDirectory),
|
||||||
};
|
};
|
||||||
@@ -347,7 +342,7 @@ impl FileSystemInner {
|
|||||||
|
|
||||||
/// From the inode of a parent node (so, a directory), returns the
|
/// From the inode of a parent node (so, a directory), returns the
|
||||||
/// child index of `name_of_directory` along with its inode.
|
/// child index of `name_of_directory` along with its inode.
|
||||||
pub(super) fn from_parent_get_position_and_inode_of_directory(
|
pub(super) fn as_parent_get_position_and_inode_of_directory(
|
||||||
&self,
|
&self,
|
||||||
inode_of_parent: Inode,
|
inode_of_parent: Inode,
|
||||||
name_of_directory: &OsString,
|
name_of_directory: &OsString,
|
||||||
@@ -382,7 +377,7 @@ impl FileSystemInner {
|
|||||||
|
|
||||||
/// From the inode of a parent node (so, a directory), returns the
|
/// From the inode of a parent node (so, a directory), returns the
|
||||||
/// child index of `name_of_file` along with its inode.
|
/// child index of `name_of_file` along with its inode.
|
||||||
pub(super) fn from_parent_get_position_and_inode_of_file(
|
pub(super) fn as_parent_get_position_and_inode_of_file(
|
||||||
&self,
|
&self,
|
||||||
inode_of_parent: Inode,
|
inode_of_parent: Inode,
|
||||||
name_of_file: &OsString,
|
name_of_file: &OsString,
|
||||||
@@ -409,7 +404,7 @@ impl FileSystemInner {
|
|||||||
/// From the inode of a parent node (so, a directory), returns the
|
/// From the inode of a parent node (so, a directory), returns the
|
||||||
/// child index of `name_of` along with its inode, whatever the
|
/// child index of `name_of` along with its inode, whatever the
|
||||||
/// type of inode is (directory or file).
|
/// type of inode is (directory or file).
|
||||||
fn from_parent_get_position_and_inode(
|
fn as_parent_get_position_and_inode(
|
||||||
&self,
|
&self,
|
||||||
inode_of_parent: Inode,
|
inode_of_parent: Inode,
|
||||||
name_of: &OsString,
|
name_of: &OsString,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-vm"
|
name = "wasmer-vm"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Runtime library support for Wasmer"
|
description = "Runtime library support for Wasmer"
|
||||||
categories = ["wasm"]
|
categories = ["wasm"]
|
||||||
keywords = ["wasm", "webassembly"]
|
keywords = ["wasm", "webassembly"]
|
||||||
@@ -11,7 +11,7 @@ readme = "README.md"
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer-types = { path = "../types", version = "=2.3.0" }
|
wasmer-types = { path = "../types", version = "=3.0.0-alpha.4" }
|
||||||
libc = { version = "^0.2", default-features = false }
|
libc = { version = "^0.2", default-features = false }
|
||||||
memoffset = "0.6"
|
memoffset = "0.6"
|
||||||
indexmap = { version = "1.6", features = ["serde-1"] }
|
indexmap = { version = "1.6", features = ["serde-1"] }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-vnet"
|
name = "wasmer-vnet"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Wasmer Virtual Networking"
|
description = "Wasmer Virtual Networking"
|
||||||
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
@@ -13,8 +13,10 @@ tracing = { version = "0.1" }
|
|||||||
typetag = { version = "0.1", optional = true }
|
typetag = { version = "0.1", optional = true }
|
||||||
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
|
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
|
||||||
slab = { version = "0.4", optional = true }
|
slab = { version = "0.4", optional = true }
|
||||||
wasmer-vfs = { path = "../vfs", version = "=2.3.0", default-features = false }
|
wasmer-vfs = { path = "../vfs", version = "=3.0.0-alpha.4", default-features = false }
|
||||||
bytes = "1"
|
bytes = "1"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = ["mem_fs"]
|
||||||
|
mem_fs = ["wasmer-vfs/mem-fs"]
|
||||||
|
host_fs = ["wasmer-vfs/host-fs"]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-wasi-experimental-io-devices"
|
name = "wasmer-wasi-experimental-io-devices"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "An experimental non-standard WASI extension for graphics"
|
description = "An experimental non-standard WASI extension for graphics"
|
||||||
categories = ["wasm"]
|
categories = ["wasm"]
|
||||||
keywords = ["wasm", "webassembly", "types"]
|
keywords = ["wasm", "webassembly", "types"]
|
||||||
@@ -14,7 +14,7 @@ edition = "2018"
|
|||||||
maintenance = { status = "experimental" }
|
maintenance = { status = "experimental" }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer-wasi = { version = "=2.3.0", path = "../wasi", default-features=false }
|
wasmer-wasi = { version = "=3.0.0-alpha.4", path = "../wasi", default-features=false }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
minifb = { version = "0.19", optional = true }
|
minifb = { version = "0.19", optional = true }
|
||||||
nix = "0.20.2"
|
nix = "0.20.2"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-wasi-local-networking"
|
name = "wasmer-wasi-local-networking"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "An WASIX extension for local networking"
|
description = "An WASIX extension for local networking"
|
||||||
categories = ["wasm"]
|
categories = ["wasm"]
|
||||||
keywords = ["wasm", "webassembly", "types"]
|
keywords = ["wasm", "webassembly", "types"]
|
||||||
@@ -14,11 +14,13 @@ edition = "2018"
|
|||||||
maintenance = { status = "experimental" }
|
maintenance = { status = "experimental" }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer-vnet = { version = "=2.3.0", path = "../vnet", default-features = false }
|
wasmer-vnet = { version = "=3.0.0-alpha.4", path = "../vnet", default-features = false }
|
||||||
wasmer-vfs = { path = "../vfs", version = "=2.3.0", default-features = false, features = [ "host-fs" ] }
|
wasmer-vfs = { path = "../vfs", version = "=3.0.0-alpha.4", default-features = false }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
bytes = "1.1"
|
bytes = "1.1"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ ]
|
default = ["host_fs"]
|
||||||
wasix = [ ]
|
wasix = [ ]
|
||||||
|
host_fs = ["wasmer-vnet/host_fs", "wasmer-vfs/host-fs"]
|
||||||
|
mem_fs = ["wasmer-vnet/mem_fs", "wasmer-vfs/mem-fs"]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-wasi-types"
|
name = "wasmer-wasi-types"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "WASI types for Wasmer WebAssembly runtime"
|
description = "WASI types for Wasmer WebAssembly runtime"
|
||||||
categories = ["wasm", "os"]
|
categories = ["wasm", "os"]
|
||||||
keywords = ["wasm", "webassembly", "wasi", "sandbox", "ABI"]
|
keywords = ["wasm", "webassembly", "wasi", "sandbox", "ABI"]
|
||||||
@@ -11,8 +11,8 @@ readme = "README.md"
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmer-types = { path = "../types", version = "=2.3.0" }
|
wasmer-types = { path = "../types", version = "=3.0.0-alpha.4" }
|
||||||
wasmer-derive = { path = "../derive", version = "=2.3.0" }
|
wasmer-derive = { path = "../derive", version = "=3.0.0-alpha.4" }
|
||||||
serde = { version = "1.0", features = ["derive"], optional=true }
|
serde = { version = "1.0", features = ["derive"], optional=true }
|
||||||
byteorder = "1.3"
|
byteorder = "1.3"
|
||||||
time = "0.2"
|
time = "0.2"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-wasi"
|
name = "wasmer-wasi"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "WASI implementation library for Wasmer WebAssembly runtime"
|
description = "WASI implementation library for Wasmer WebAssembly runtime"
|
||||||
categories = ["wasm", "os"]
|
categories = ["wasm", "os"]
|
||||||
keywords = ["wasm", "webassembly", "wasi", "sandbox", "ABI"]
|
keywords = ["wasm", "webassembly", "wasi", "sandbox", "ABI"]
|
||||||
@@ -19,12 +19,12 @@ thiserror = "1"
|
|||||||
generational-arena = { version = "0.2" }
|
generational-arena = { version = "0.2" }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
getrandom = "0.2"
|
getrandom = "0.2"
|
||||||
wasmer-wasi-types = { path = "../wasi-types", version = "=2.3.0" }
|
wasmer-wasi-types = { path = "../wasi-types", version = "=3.0.0-alpha.4" }
|
||||||
wasmer = { path = "../api", version = "=2.3.0", default-features = false }
|
wasmer = { path = "../api", version = "=3.0.0-alpha.4", default-features = false }
|
||||||
wasmer-vfs = { path = "../vfs", version = "=2.3.0", default-features = false }
|
wasmer-vfs = { path = "../vfs", version = "=3.0.0-alpha.4", default-features = false }
|
||||||
wasmer-vbus = { path = "../vbus", version = "=2.3.0", default-features = false }
|
wasmer-vbus = { path = "../vbus", version = "=3.0.0-alpha.4", default-features = false }
|
||||||
wasmer-vnet = { path = "../vnet", version = "=2.3.0", default-features = false }
|
wasmer-vnet = { path = "../vnet", version = "=3.0.0-alpha.4", default-features = false }
|
||||||
wasmer-wasi-local-networking = { path = "../wasi-local-networking", version = "=2.3.0", default-features = false, optional = true }
|
wasmer-wasi-local-networking = { path = "../wasi-local-networking", version = "=3.0.0-alpha.4", default-features = false, optional = true }
|
||||||
typetag = { version = "0.1", optional = true }
|
typetag = { version = "0.1", optional = true }
|
||||||
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
|
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
|
||||||
bincode = { version = "1.3", optional = true }
|
bincode = { version = "1.3", optional = true }
|
||||||
|
|||||||
@@ -22,60 +22,43 @@ except ImportError:
|
|||||||
|
|
||||||
|
|
||||||
# TODO: find this automatically
|
# TODO: find this automatically
|
||||||
target_version = "2.3.0"
|
target_version = "3.0.0-alpha.4"
|
||||||
|
|
||||||
# TODO: generate this by parsing toml files
|
# TODO: generate this by parsing toml files
|
||||||
dep_graph = {
|
dep_graph = {
|
||||||
"wasmer-types": set([]),
|
"wasmer-types": set([]),
|
||||||
"wasmer-derive": set([]),
|
"wasmer-derive": set([]),
|
||||||
"wasmer-vm": set(["wasmer-types", "wasmer-artifact"]),
|
"wasmer-vm": set(["wasmer-types"]),
|
||||||
"wasmer-compiler": set(["wasmer-types"]),
|
"wasmer-compiler": set(["wasmer-types"]),
|
||||||
|
"wasmer-compiler-singlepass": set(["wasmer-types", "wasmer-compiler"]),
|
||||||
|
"wasmer-compiler-cranelift": set(["wasmer-types", "wasmer-compiler"]),
|
||||||
"wasmer-compiler-cli": set(
|
"wasmer-compiler-cli": set(
|
||||||
[
|
[
|
||||||
"wasmer-engine-universal-artifact",
|
|
||||||
"wasmer-compiler",
|
"wasmer-compiler",
|
||||||
"wasmer-types",
|
"wasmer-types",
|
||||||
"wasmer-compiler-singlepass",
|
"wasmer-compiler-singlepass",
|
||||||
"wasmer-compiler-cranelift",
|
"wasmer-compiler-cranelift",
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
"wasmer-engine-universal-artifact": set(
|
|
||||||
["wasmer-artifact", "wasmer-types", "wasmer-compiler"]
|
|
||||||
),
|
|
||||||
"wasmer-artifact": set(["wasmer-types", "wasmer-compiler"]),
|
|
||||||
"wasmer-object": set(["wasmer-types", "wasmer-compiler"]),
|
"wasmer-object": set(["wasmer-types", "wasmer-compiler"]),
|
||||||
"wasmer-engine": set(
|
|
||||||
["wasmer-types", "wasmer-compiler", "wasmer-artifact", "wasmer-vm"]
|
|
||||||
),
|
|
||||||
"wasmer-compiler-singlepass": set(["wasmer-types", "wasmer-compiler"]),
|
|
||||||
"wasmer-compiler-cranelift": set(["wasmer-types", "wasmer-compiler"]),
|
|
||||||
"wasmer-compiler-llvm": set(["wasmer-compiler", "wasmer-vm", "wasmer-types"]),
|
"wasmer-compiler-llvm": set(["wasmer-compiler", "wasmer-vm", "wasmer-types"]),
|
||||||
"wasmer-engine-universal": set(
|
|
||||||
[
|
|
||||||
"wasmer-engine-universal-artifact",
|
|
||||||
"wasmer-types",
|
|
||||||
"wasmer-compiler",
|
|
||||||
"wasmer-vm",
|
|
||||||
"wasmer-engine",
|
|
||||||
]
|
|
||||||
),
|
|
||||||
"wasmer": set(
|
"wasmer": set(
|
||||||
[
|
[
|
||||||
"wasmer-artifact",
|
|
||||||
"wasmer-vm",
|
"wasmer-vm",
|
||||||
"wasmer-compiler",
|
"wasmer-compiler",
|
||||||
"wasmer-derive",
|
"wasmer-derive",
|
||||||
"wasmer-engine",
|
|
||||||
"wasmer-types",
|
"wasmer-types",
|
||||||
"wasmer-compiler-singlepass",
|
"wasmer-compiler-singlepass",
|
||||||
"wasmer-compiler-cranelift",
|
"wasmer-compiler-cranelift",
|
||||||
"wasmer-compiler-llvm",
|
"wasmer-compiler-llvm",
|
||||||
"wasmer-engine-universal",
|
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
"wasmer-vfs": set([]),
|
"wasmer-vfs": set([]),
|
||||||
|
"wasmer-vbus": set([]),
|
||||||
|
"wasmer-vnet": set([]),
|
||||||
|
"wasmer-wasi-local-networking": set([]),
|
||||||
"wasmer-cache": set(["wasmer"]),
|
"wasmer-cache": set(["wasmer"]),
|
||||||
"wasmer-wasi": set(["wasmer", "wasmer-wasi-types", "wasmer-vfs"]),
|
"wasmer-wasi": set(["wasmer", "wasmer-wasi-types", "wasmer-vfs", "wasmer-vbus", "wasmer-vnet"]),
|
||||||
"wasmer-wasi-types": set(["wasmer-types"]),
|
"wasmer-wasi-types": set(["wasmer-types"]),
|
||||||
"wasmer-wasi-experimental-io-devices": set(["wasmer-wasi"]),
|
"wasmer-wasi-experimental-io-devices": set(["wasmer-wasi"]),
|
||||||
"wasmer-emscripten": set(["wasmer"]),
|
"wasmer-emscripten": set(["wasmer"]),
|
||||||
@@ -87,8 +70,6 @@ dep_graph = {
|
|||||||
"wasmer-compiler-singlepass",
|
"wasmer-compiler-singlepass",
|
||||||
"wasmer-compiler-llvm",
|
"wasmer-compiler-llvm",
|
||||||
"wasmer-emscripten",
|
"wasmer-emscripten",
|
||||||
"wasmer-engine",
|
|
||||||
"wasmer-engine-universal",
|
|
||||||
"wasmer-middlewares",
|
"wasmer-middlewares",
|
||||||
"wasmer-wasi",
|
"wasmer-wasi",
|
||||||
"wasmer-types",
|
"wasmer-types",
|
||||||
@@ -104,8 +85,6 @@ dep_graph = {
|
|||||||
"wasmer-compiler-singlepass",
|
"wasmer-compiler-singlepass",
|
||||||
"wasmer-compiler-llvm",
|
"wasmer-compiler-llvm",
|
||||||
"wasmer-emscripten",
|
"wasmer-emscripten",
|
||||||
"wasmer-engine",
|
|
||||||
"wasmer-engine-universal",
|
|
||||||
"wasmer-vm",
|
"wasmer-vm",
|
||||||
"wasmer-wasi",
|
"wasmer-wasi",
|
||||||
"wasmer-wasi-experimental-io-devices",
|
"wasmer-wasi-experimental-io-devices",
|
||||||
@@ -120,20 +99,15 @@ dep_graph = {
|
|||||||
# where each crate is located in the `lib` directory
|
# where each crate is located in the `lib` directory
|
||||||
# TODO: this could also be generated from the toml files
|
# TODO: this could also be generated from the toml files
|
||||||
location = {
|
location = {
|
||||||
"wasmer-artifact": "artifact",
|
|
||||||
"wasmer-engine-universal-artifact": "universal-artifact",
|
|
||||||
"wasmer-compiler-cli": "cli-compiler",
|
"wasmer-compiler-cli": "cli-compiler",
|
||||||
"wasmer-types": "types",
|
"wasmer-types": "types",
|
||||||
"wasmer-derive": "derive",
|
"wasmer-derive": "derive",
|
||||||
"wasmer-vm": "vm",
|
"wasmer-vm": "vm",
|
||||||
"wasmer-compiler": "compiler",
|
"wasmer-compiler": "compiler",
|
||||||
"wasmer-object": "object",
|
"wasmer-object": "object",
|
||||||
"wasmer-engine": "engine",
|
|
||||||
"wasmer-compiler-singlepass": "compiler-singlepass",
|
"wasmer-compiler-singlepass": "compiler-singlepass",
|
||||||
"wasmer-compiler-cranelift": "compiler-cranelift",
|
"wasmer-compiler-cranelift": "compiler-cranelift",
|
||||||
"wasmer-compiler-llvm": "compiler-llvm",
|
"wasmer-compiler-llvm": "compiler-llvm",
|
||||||
"wasmer-engine": "engine",
|
|
||||||
"wasmer-engine-universal": "engine-universal",
|
|
||||||
"wasmer-cache": "cache",
|
"wasmer-cache": "cache",
|
||||||
"wasmer": "api",
|
"wasmer": "api",
|
||||||
"wasmer-wasi": "wasi",
|
"wasmer-wasi": "wasi",
|
||||||
@@ -143,7 +117,10 @@ location = {
|
|||||||
"wasmer-c-api": "c-api",
|
"wasmer-c-api": "c-api",
|
||||||
"wasmer-middlewares": "middlewares",
|
"wasmer-middlewares": "middlewares",
|
||||||
"wasmer-vfs": "vfs",
|
"wasmer-vfs": "vfs",
|
||||||
|
"wasmer-vbus": "vbus",
|
||||||
|
"wasmer-vnet": "vnet",
|
||||||
"wasmer-cli": "cli",
|
"wasmer-cli": "cli",
|
||||||
|
"wasmer-wasi-local-networking": "wasi-local-networking",
|
||||||
"wasmer-wast": "../tests/lib/wast",
|
"wasmer-wast": "../tests/lib/wast",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
: "${FD:=fd}"
|
: "${FD:=fd}"
|
||||||
|
|
||||||
# A script to update the version of all the crates at the same time
|
# A script to update the version of all the crates at the same time
|
||||||
PREVIOUS_VERSION='2.2.1'
|
PREVIOUS_VERSION='3.0.0-alpha.3'
|
||||||
NEXT_VERSION='2.3.0'
|
NEXT_VERSION='3.0.0-alpha.4'
|
||||||
|
|
||||||
# quick hack
|
# quick hack
|
||||||
${FD} Cargo.toml --exec sed -i '{}' -e "s/version = \"$PREVIOUS_VERSION\"/version = \"$NEXT_VERSION\"/"
|
${FD} Cargo.toml --exec sed -i '{}' -e "s/version = \"$PREVIOUS_VERSION\"/version = \"$NEXT_VERSION\"/"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[Setup]
|
[Setup]
|
||||||
AppName=Wasmer
|
AppName=Wasmer
|
||||||
AppVersion=2.3.0
|
AppVersion=3.0.0-alpha.4
|
||||||
DefaultDirName={pf}\Wasmer
|
DefaultDirName={pf}\Wasmer
|
||||||
DefaultGroupName=Wasmer
|
DefaultGroupName=Wasmer
|
||||||
Compression=lzma2
|
Compression=lzma2
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-integration-tests-cli"
|
name = "wasmer-integration-tests-cli"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||||
description = "CLI integration tests"
|
description = "CLI integration tests"
|
||||||
repository = "https://github.com/wasmerio/wasmer"
|
repository = "https://github.com/wasmerio/wasmer"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-integration-tests-ios"
|
name = "wasmer-integration-tests-ios"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||||
description = "iOS integration tests"
|
description = "iOS integration tests"
|
||||||
repository = "https://github.com/wasmerio/wasmer"
|
repository = "https://github.com/wasmerio/wasmer"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmer-wast"
|
name = "wasmer-wast"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||||
description = "wast testing support for wasmer"
|
description = "wast testing support for wasmer"
|
||||||
license = "MIT OR Apache-2.0 WITH LLVM-exception"
|
license = "MIT OR Apache-2.0 WITH LLVM-exception"
|
||||||
@@ -12,9 +12,9 @@ edition = "2018"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
wasmer = { path = "../../../lib/api", version = "=2.3.0", default-features = false }
|
wasmer = { path = "../../../lib/api", version = "=3.0.0-alpha.4", default-features = false }
|
||||||
wasmer-wasi = { path = "../../../lib/wasi", version = "=2.3.0" }
|
wasmer-wasi = { path = "../../../lib/wasi", version = "=3.0.0-alpha.4" }
|
||||||
wasmer-vfs = { path = "../../../lib/vfs", version = "=2.3.0" }
|
wasmer-vfs = { path = "../../../lib/vfs", version = "=3.0.0-alpha.4" }
|
||||||
wast = "38.0"
|
wast = "38.0"
|
||||||
serde = "1"
|
serde = "1"
|
||||||
tempfile = "3"
|
tempfile = "3"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasi-test-generator"
|
name = "wasi-test-generator"
|
||||||
version = "2.3.0"
|
version = "3.0.0-alpha.4"
|
||||||
description = "Tests for our WASI implementation"
|
description = "Tests for our WASI implementation"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use std::io::prelude::*;
|
|||||||
use super::util;
|
use super::util;
|
||||||
use super::wasi_version::*;
|
use super::wasi_version::*;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct NativeOutput {
|
pub struct NativeOutput {
|
||||||
stdout: String,
|
stdout: String,
|
||||||
stderr: String,
|
stderr: String,
|
||||||
@@ -284,6 +284,8 @@ pub struct WasiTest {
|
|||||||
|
|
||||||
impl WasiTest {
|
impl WasiTest {
|
||||||
fn into_wasi_wast(self) -> String {
|
fn into_wasi_wast(self) -> String {
|
||||||
|
use std::fmt::Write;
|
||||||
|
|
||||||
let mut out = format!(
|
let mut out = format!(
|
||||||
";; This file was generated by https://github.com/wasmerio/wasi-tests\n
|
";; This file was generated by https://github.com/wasmerio/wasi-tests\n
|
||||||
(wasi_test \"{}\"",
|
(wasi_test \"{}\"",
|
||||||
@@ -297,7 +299,7 @@ impl WasiTest {
|
|||||||
.map(|(name, value)| format!("\"{}={}\"", name, value))
|
.map(|(name, value)| format!("\"{}={}\"", name, value))
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join(" ");
|
.join(" ");
|
||||||
out += &format!("\n (envs {})", envs);
|
let _ = write!(out, "\n (envs {})", envs);
|
||||||
}
|
}
|
||||||
if !self.options.args.is_empty() {
|
if !self.options.args.is_empty() {
|
||||||
let args = self
|
let args = self
|
||||||
@@ -307,7 +309,7 @@ impl WasiTest {
|
|||||||
.map(|v| format!("\"{}\"", v))
|
.map(|v| format!("\"{}\"", v))
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join(" ");
|
.join(" ");
|
||||||
out += &format!("\n (args {})", args);
|
let _ = write!(out, "\n (args {})", args);
|
||||||
}
|
}
|
||||||
|
|
||||||
if !self.options.dir.is_empty() {
|
if !self.options.dir.is_empty() {
|
||||||
@@ -318,7 +320,7 @@ impl WasiTest {
|
|||||||
.map(|v| format!("\"{}\"", v))
|
.map(|v| format!("\"{}\"", v))
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join(" ");
|
.join(" ");
|
||||||
out += &format!("\n (preopens {})", preopens);
|
let _ = write!(out, "\n (preopens {})", preopens);
|
||||||
}
|
}
|
||||||
if !self.options.mapdir.is_empty() {
|
if !self.options.mapdir.is_empty() {
|
||||||
let map_dirs = self
|
let map_dirs = self
|
||||||
@@ -328,7 +330,7 @@ impl WasiTest {
|
|||||||
.map(|(a, b)| format!("\"{}:{}\"", a, b))
|
.map(|(a, b)| format!("\"{}:{}\"", a, b))
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join(" ");
|
.join(" ");
|
||||||
out += &format!("\n (map_dirs {})", map_dirs);
|
let _ = write!(out, "\n (map_dirs {})", map_dirs);
|
||||||
}
|
}
|
||||||
if !self.options.tempdir.is_empty() {
|
if !self.options.tempdir.is_empty() {
|
||||||
let temp_dirs = self
|
let temp_dirs = self
|
||||||
@@ -338,22 +340,22 @@ impl WasiTest {
|
|||||||
.map(|td| format!("\"{}\"", td))
|
.map(|td| format!("\"{}\"", td))
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join(" ");
|
.join(" ");
|
||||||
out += &format!("\n (temp_dirs {})", temp_dirs);
|
let _ = write!(out, "\n (temp_dirs {})", temp_dirs);
|
||||||
}
|
}
|
||||||
|
|
||||||
out += &format!("\n (assert_return (i64.const {}))", self.result);
|
let _ = write!(out, "\n (assert_return (i64.const {}))", self.result);
|
||||||
if let Some(stdin) = &self.options.stdin {
|
if let Some(stdin) = &self.options.stdin {
|
||||||
out += &format!("\n (stdin {:?})", stdin);
|
let _ = write!(out, "\n (stdin {:?})", stdin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if !self.stdout.is_empty() {
|
if !self.stdout.is_empty() {
|
||||||
out += &format!("\n (assert_stdout {:?})", self.stdout);
|
let _ = write!(out, "\n (assert_stdout {:?})", self.stdout);
|
||||||
}
|
}
|
||||||
if !self.stderr.is_empty() {
|
if !self.stderr.is_empty() {
|
||||||
out += &format!("\n (assert_stderr {:?})", self.stderr);
|
let _ = write!(out, "\n (assert_stderr {:?})", self.stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
out += "\n)\n";
|
let _ = write!(out, "\n)\n");
|
||||||
|
|
||||||
out
|
out
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user