* Add test for dangling file/dir handles
This commit adds a test for dangling file/dir handles. The logic is
quite simple: we first create a resource (file or dir), get a WASI file
descriptor to it, remove the resource without closing the FD, and then
try to re-create it.
* Disable on Windows for now
* Fix fuzz target compilation.
* Bump version to 0.7.0
* Temporarily disable fuzz tests
Temporarily disable fuzz tests until https://github.com/bytecodealliance/cranelift/issues/1216 is resolved.
* Fix publish-all.sh to not modify the witx crate.
* Remove the "publish = false" attribute from Lightbeam.
* Add a README.md for wasmtime-interface-types.
* Remove the "rust" category.
This fixes the following warning:
warning: the following are not valid category slugs and were ignored: rust. Please see https://crates.io/category_slugs for the list of all category slugs.
* Mark wasmtime-cli as "publish = false".
* Sort the publishing rules in topological order.
Also, publish nightly-only crates with cargo +nightly.
This commit fixes rights check for `fd_pread` and `fd_pwrite` to be
conformant with the WASI spec. In the spec, it is clearly stated that
the right to invoke `__wasi_fd_pread()` requires a combination of
`__WASI_RIGHT_FD_READ` with `__WASI_RIGHT_FD_SEEK`, and similarly for
`__wasi_fd_pwrite()` the combination is `__WASI_RIGHT_FD_WRITE` with
`__WASI_RIGHT_FD_SEEK`. Relevant link to the spec: [__wasi_rights_t].
[__wasi_rights_t]: https://github.com/WebAssembly/WASI/blob/master/phases/snapshot/docs/wasi_unstable_preview1.md#__wasi_rights_t-uint64_t-bitfield
* Reorganize wasi-misc-tests.
Move wasi-misc-tests out of wasi-common, to break a dependency cycle;
previously, wasmtime-* depended on wasi-common, but wasi-common
dev-dependended on wasmtime-*.
Now, wasi-common no longer dev-depends on wasmtime-*; instead, the
tests are in their own crate which depends on wasi-common and on
wasmtime-*.
Also, rename wasi-misc-tests to wasi-tests for simplicity.
This also removes the "wasm_tests" feature; it's replaced by the
"test-programs" feature.
* Update the CI script to use the new feature name.
* Update the CI script to use the new feature name in one more place.
* Change a `write!` to a `writeln!`.
* Tidy up the `hello` example for `wasmtime`
* Remove the `*.wat` and `*.wasm` files and instead just inline the
`*.wat` into the example.
* Touch up comments so they're not just a repeat of the `println!`
below.
* Move `*.wat` for `memory` example inline
No need to handle auxiliary files with the ability to parse it inline!
* Move `multi.wasm` inline into `multi.rs` example
* Move `*.wasm` for gcd example inline
* Move `*.wat` inline with `import_calling_export` test
* Remove checked in `lightbeam/test.wasm`
Instead move the `*.wat` into the source and parse it into wasm there.
* Run rustfmt
This commit is an attempt to reduce the number of crates necessary to
link to when using `wasmtime::Config` in "default mode" or with only one
or two tweaks. The change moves to a builder-style pattern for `Config`
to only require importing crates as necessary if you configure a
particular setting. This then also propagates that change to `Context`
as well by taking a `Config` instead of requiring that all arguments are
passed alone.
For some weird reason (probably when migrating the codebase from
`wasi-common` repo to `wasmtime`), these did not get enabled for the
Windows platform.
This commit adds a relatively complete test case for the `path_link`
syscall. This commit should serve as some prep work for implementing
`path_link` on Windows (which will follow in a subsequent PR).
This commit enables the multi-value features in the Python extension
to be usable by-default with interface types. Additionally this removes
some code which panics on multi-value but doesn't end up getting used
today.
* Allow using WASI APIs in the Python extension
This commit adds support to the Python extension to load the WASI
implementation when a WASI module is seen allowing Python to load
WebAssembly modules that use WASI. This is pretty primitive right now
because there's no way to configure the environment/args/preopens/etc,
but it's hoped to be at least a start!
* rustfmt
* Refactor checks for the wasi module name
* Move the check into `wasmtime-wasi` itself
* Make it conservative for now and match anything that says `wasi*`
* Leave a `FIXME` for improving this later on
* Enable missing feature of winapi for `winx`
* Dynamically load utimensat if exists on the host
This commit introduces a change to file time management for *nix based
hosts in that it firstly tries to load `utimensat` symbol, and if it
doesn't exist, then falls back to `utimes` instead. This change is
borrowing very heavily from [filetime] crate, however, it introduces a
couple of helpers and methods specific to WASI use case (or more
generally, to a use case which requires modifying times of entities
specified by a pair `(DirFD, RelativePath)` rather than the typical
file time specification based only absolute path or raw file descriptor
as is the case with [filetime] crate. The trick here is, that on kernels
which do not have `utimensat` symbol, this implementation emulates this
behaviour by a combination of `openat` and `utimes`.
This commit also is meant to address #516.
[filetime]: https://github.com/alexcrichton/filetime
* Fix symlink NOFOLLOW flag setting
* Add docs and specify UTIME_NOW/OMIT on Linux
Previously, we relied on [libc] crate for `UTIME_NOW` and `UTIME_OMIT`
constants on Linux. However, following the convention assumed in
[filetime] crate, this is now changed to directly specified by us
in our crate.
[libc]: https://github.com/rust-lang/libc
[filetime]: https://github.com/alexcrichton/filetime
* Refactor UTIME_NOW/OMIT for BSD
* Address final discussion points
* Reduce duplication in error messages
This commit removes duplication in error messages where the same text
would show up multiple times in a fully rendered error message.
When using `derive(Error)` when the `#[from]` attribute is used there's
no need to also render that payload into the error string because the
`#[from]` establishes a "backtrace" which means that when the full
context of an error is rendered it will include the `#[from]` in the
lower frames of the backtrace anyway.
This commit audits the `derive(Error)` implementations to avoid
duplication in the rendered error messages, ensuring that if `#[from]`
is used then the `#[from]` field isn't also rendered in the textual
description.
* Search the full error in wast assertions
Don't just search the top error, but search the whole backtrace by using
the `{:?}` format instead of `{}`.
* General Cargo.toml cleanup.
- Remove travis-ci attributes.
- Remove "experimental" badges from actively-developed crates.
- Reflow some long lines.
- Use dependency features consistently.
- Add readme attributes
* Update WASI to the latest trunk.
This notably adds a .gitignore file for the WASI directory.
* Refactor Lightbeam's tests.
This refactors Lightbeam's tests.rs file into several pieces, separating
quickcheck tests into their own file, and moving tests which can be run as
wast tests into `tests/misc_testsuite`, and creating a tests directory
for the rest.
* Remove the old filetests tests.
These are all covered by misc_testsuite and spec_testsuite tests.
* rustfmt
* Remove the "bench" feature.