This commit moves a couple of things around:
* separates the logic of `path_unlink_file` into separate impls
for linux and BSD-style nixes
* moves implementation consts into appropriate impl modules: linux
or bsd
* cleans up `utime_now` and `utime_omit` for BSD-style nixes
This commit fixes an issue with incorrect handling of /dev/(u)random
on Linux. It turns out that `nix::unistd::isatty` call handled only
the POSIX spec case where `ENOTTY` is returned in case the passed
in file descriptor is OK but not a TTY, whereas on Linux this is not
always the case. On Linux, it can be the case that `EINVAL` is returned
instead and this case AFAIK is not handled by the `nix` crate. This
commit fixes this by using `libc::isatty` syscall directly and checking
the return values.
* Don't run the spec_testsuite tests if the submodule isn't checked out.
This way, if someone checks out the repository without checking out the
submodules, they can still run "cargo test".
Also, fix a warning in the generated test runner code.
* Print a message if the spec_testsuite submodule is not enabled.
* Move the `#[cfg(test)]` to the top-level `mod`.
* Update the README.md.
Feature the wasmtime.dev website, update WASI content.
With Lightbeam moving into the Wasmtime repo, it's no longer necessary
to use git submodules to build Wasmtime.
* Put misc_testsuite behind a feature gate
This PR puts building and generating of misc_testsuite behind
a feature gate "misc_testsuite". This is mainly to allow projects
which pull `wasi-common` as a dependency not to have to have
`wasm32-wasi` target installed in order to build it as it currently
is.
* Update the CI
* Rename feature to wasm_tests
* Explain integration testing in the README
This adds a `--always-lightbeam` option as well as an `--always-cranelift`
option, to allow the compilation strategy to be selected via the
command-line. This also enables regular testing for Lightbeam.
This fixes the memory leaks in the following functions which should not be
returning "owned" pointers:
* `wasm_extern_as_func`
* `wasm_func_as_extern`
* `wasm_extern_as_global`
* `wasm_global_as_extern`
* `wasm_extern_as_memory`
* `wasm_extern_as_table`
Additionally, this commit implements the `wasm_memory_as_extern` and
`wasm_table_as_extern` functions.
Fixes#394.
In trying to build the lightbeam feature in wasmtime there are
compile errors mostly related to outdated or missing trait
definitions. This patch moves the current cranelift codegen
dependence to 0.44 in support of that, though other changes
are still needed in wasmtime to get the feature to build.
* Begin sketching out a new high-level `fs` API.
This is a very preliminary sketch of #83. It doesn't even compile yet,
but it shows a possible high-level structure of such an API.
* Stub out more functionality.
* Switch from a lazy_static WasiCtx to a borrowed one.
* Reformat some comments.
* Code-quote `Self`.
* Implement error translation for Windows.
* Calls to `fd_close` are now unsafe.
* Implement a few more functions.
* Open /dev/null for writing as well as reading.
Port this fix to wasi-common:
b905c44483
* Remove all remaining uses of `std::mem::uninitialized`.
Patch inspired by:
2d6519d051
* Replace libc::memcpy() calls with std::ptr::copy_nonoverlapping()
Port this fix to wasi-common:
a3f3a33e9b
* Pass `WasiError` by value.
It's a `u16` underneath, so we can pass it by value.
* Avoid unnecessary explicit lifetime parameters.
* Use immutable references rather than mutable references.
Patch inspired by:
54baa4c38c
With 92a19e9398 the optimisation levels of cranelift were renamed, without this change trying to use the -o flag on wasmtime runtime results in "error: Unexpected value for a setting, expected any among none, speed, speed_and_size".
"best" was renamed "speed_and_size", although I think "speed" is more adapted to wastime.
Bye,
JB.
This commit implements populating the table imports of a module from the API.
It also allows for `anyref` in table types as per the reference types proposal.