493: feat(runtime-c-api) Improve error message when instantiating a module r=Hywan a=Hywan
This patch improves the error message returned by `wasmer_module_instantiate`.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
490: Add MiddlewareChain and StreamingCompiler to runtime r=syrusakbary a=bjfish
It would be nice to add `MiddlewareChain` and `StreamingCompiler` to runtime to be able to use these without having to include the `runtime-core` as a dependency. For example:
```rust
use wasmer_runtime::{MiddlewareChain, StreamingCompiler};
use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG;
use wasmer_middleware_common::metering::Metering;
let limit = 1_000_000;
let c: StreamingCompiler<SinglePassMCG, _, _, _, _> = StreamingCompiler::new(move || {
let mut chain = MiddlewareChain::new();
chain.push(Metering::new(limit));
chain
});
wasmer_runtime::compile_with(&prepared_code, &c)
.map_err(|e| Error::Wasmer(format!("{}", e)))
chain
});
wasmer_runtime::compile_with(&prepared_code, &c)
.map_err(|e| Error::Wasmer(format!("{}", e)))
```
Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
450: Metering. r=bjfish a=losfair
TODO
- [x] Add test to verify points used after function call
- [x] Add test to verify function call will trap
- [x] Add documentation
Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
484: fix bugs in emscripten socket syscalls r=MarkMcCaskey a=MarkMcCaskey
resolves#482
This PR fixes:
- incorrect argument order
- which cascaded in to a casting issue
- which cascaded in to misaligning the arguments of a function
- which cascaded in to attempting to access an OOB pointer
- sets fd limit to 1024, rather than emscripten's 64
- updates `prlimit64` to return the correct result for `RLIMIT_NOFILE`
- fixes bug in `prlimit64` due to a mistransaltion of the emscripten javascript
Co-authored-by: Mark McCaskey <mark@wasmer.io>