Commit Graph

2218 Commits

Author SHA1 Message Date
Jakub Konka
2ada299b95 Add docs section 2019-10-25 11:52:18 +02:00
Jakub Konka
a04aa5860d Update test configuration 2019-10-25 11:52:18 +02:00
Jakub Konka
10e0b87ebf Update MSRV to 1.37.0 2019-10-25 11:52:18 +02:00
Jakub Konka
be1f8c0325 Update ci.yml 2019-10-25 11:52:18 +02:00
Jakub Konka
b0199ef396 Enable Github Actions 2019-10-25 11:52:18 +02:00
vms
a34439de42 optimize memory.grow 0 (#443) 2019-10-24 15:56:04 -07:00
Artur Jamro
5a10879d5b Enable assert_unlinkable check (#451) 2019-10-24 15:37:01 -07:00
Jakub Konka
8e45a14cec Fast-forward wasmtime to latest rev 2019-10-24 12:07:45 +02:00
Jakub Konka
875eea6052 Update poll_oneoff's signature
This PR updates `wasmtime_wasi` crate by adjusting `poll_oneoff`'s
signature to that introduced in `wasi_common` in
CraneStation/wasi-common#137. This change is required in order to
fix #440.
2019-10-24 11:47:35 +02:00
Jakub Konka
3a374d0016 Update poll_oneoff API
This commit updates `poll_oneoff`'s API in a potentially least
invasive way. That is, it adds unused `WasiCtx` argument to the
syscall which will be required by #137. I am hopeful that this way
 #137 can pass all tests and hence this commit should aid the review
 process.
2019-10-24 11:19:33 +02:00
Dan Gohman
a7fa6bdb31 Fix fuzz and wasi-c builds (#447)
* Fix the wasmtime-wasi-c crate build and upgrade it to Rust 2018.

* Fix the fuzz build.
2019-10-23 14:05:23 -07:00
Yury Delendik
876d5e1075 [wasmtime-api] Multi value api support (#448) 2019-10-23 14:09:27 -05:00
Dan Gohman
bd8d550ba3 Improve Cargo.toml files for publishing (#141)
* Add versions to the crates.

This is needed for publishing on crates.io.

* Add a few Cargo.toml attributes to make the crates.io page friendlier.
2019-10-23 19:17:22 +02:00
Dan Gohman
056e1d8cc0 Add more links in the fs module's documentation. 2019-10-23 19:16:18 +02:00
Jakub Konka
951456d79b Update misc_testsuite to latest master 2019-10-23 19:13:05 +02:00
Johnnie Birch
a3dd4b91e1 Fix lightbeam build broken when supporting ModuleTranslateState (#445) 2019-10-22 16:18:54 -07:00
Andrew Brown
8c4cbf9a55 Update SIMD spec tests to latest upstream revision (#444) 2019-10-22 16:16:51 -07:00
Jakub Konka
63c1f71036 Sync with latest wasmtime rev
This commit syncs tests with latest wasmtime revision.
As such, it now utilises the `wasmtime-api` crate for
runtime setup.

Closes #126, #127, #128, #129.
2019-10-22 15:27:21 +02:00
Jakub Konka
0d63cc2dbc Fix remove_directory_trailing_slashes on Windows
This commit provides a fix for `remove_directory_trailing_slashes`
test case on Windows. It adds a missing mapping between the following
WinAPI error code and WASI error:

```
ERROR_DIRECTORY => __WASI_ENOTDIR
```

where `ERROR_DIRECTORY` is thrown when the directory name is invalid.
2019-10-22 10:12:54 +02:00
Alex Crichton
e37168a88d Add back wasmtime-wast support for V128 (#442)
Accidentally left removed #434 when I meant to add it back in! Updates
the `wast` crate dependency and adds support for translating
`v128.const` instructions to a `RuntimeValue`

Closes #441
2019-10-21 15:51:59 -07:00
Alex Crichton
9947bc5209 Switch from wabt crate to wast (#434)
* Switch lightbeam from `wabt` to `wast`

Switch from a C++-based `*.wat` parser to a Rust-based parser

* Remove unneeded `wabt` dev-dependency from wasmtime-api

* Rewrite `wasmtime-wast` crate with `wast-parser`

This commit moves the `wasmtime-wast` crate off the `wabt` crate on to
the `wast-parser` crate which is a Rust implementation of a `*.wast` and
`*.wat` parser. The intention here is to continue to reduce the amount
of C++ required to build wasmtime!

* Use new `wat` and `wast` crate names
2019-10-18 13:25:48 -07:00
Dan Gohman
ef010b44b7 Fix nondeterminism in the preopen order.
We iterate over the preopens to present them to the WASI program, so
storing them in a `HashMap` means this order is nondeterministic. Switch
to a `Vec` of tuples instead. This means we don't eliminate duplicates,
but they should be rare.
2019-10-18 19:52:08 +02:00
Dan Gohman
4120d3b44f Optimize away an owned string in path_readlink. 2019-10-18 19:37:58 +02:00
Dan Gohman
14bad3cb97 Ensure that each crate has its own copy of the LICENSE file.
On crates.io, each crate is distributed separately, so ensure that each
crate has a license file.
2019-10-18 19:27:36 +02:00
Dan Gohman
ebef2c6b57 Rename "always_lightbeam" to "lightbeam" in more places. (#404) 2019-10-17 17:15:31 -07:00
Dan Gohman
877152ee5c Use the libstd instead of the errno crate in wasmtime-runtime. (#408)
Rust's standard library now has a way to read the OS errno value, so use
that instead of depending on the errno crate in wasmtime-runtime.
2019-10-17 17:14:57 -07:00
Alex Crichton
50beb21b63 Add a missing api to the wasm C API (#433)
This was used when [prototyping] but I found it wasn't implemented yet!

[prototyping]: https://github.com/dtolnay/watt/issues/2#issuecomment-543007365
2019-10-17 17:14:15 -07:00
Nick Fitzgerald
842faf5aa6 Support for multi-value wasm (#399)
* deps: bump wasmparser to 0.39.2

This has a bug fix for multi-value Wasm validation that is required for getting
the spec tests passing.

https://github.com/yurydelendik/wasmparser.rs/pull/135

* Update cranelift to 0.46.1 to get multi-value Wasm support

The `cranelift_wasm` APIs had to change a little bit to maintain state necessary
when translating multi-value Wasm blocks. The `translate_module` function now
returns a `ModuleTranslationState` that is borrowed during each function's
translation.

* Enable multi-value proposal's spec tests

This enables all the Wasm multi-value proposal's spec tests other than the ones
that rely on functions having more return values than registers available on the
target. That is not supported by cranelift yet.

* wasmtime-interface-types: always use multi-value Wasm

And remove the return pointer hacks that work around the lack of multi-value.
2019-10-17 17:12:01 -07:00
Jakub Konka
9d54f84a32 Fast-forward wasi-common to latest git rev 2019-10-17 12:02:58 +02:00
Jakub Konka
c3bf04042e Fixes path_symlink_trailing_slashes test case (#125)
* Fixes `path_symlink_trailing_slashes` test case

This commit:
* adds a couple `log::debug!` macro calls in and around `path_get`
  for easier future debugging
* changes impl of `path_symlink` hostcall to actually *require*
  the final component (matching the impl of WASI in C)
* ignores the error `__WASI_ENOTDIR` in `path_get`'s `readlinkat` call
  which is not meant to be an error at this stage (i.e., this
  potentially erroneous condition *will be* handled later, in
  one of the layers above)

* Fixes `path_symlink_trailing` slashes on BSD-nixes

This commit:
* makes `path_symlink` host-specific (Linux and BSD-like nixes
  now have their own differing implementations)
* on BSD-like nixes, when `ENOTDIR` is returned from `symlinkat`
  it checks whether the target path contains a trailing slash,
  strips it, and then checks if the target path without the trailing
  slash exists; if yes, then converts the error code to `EEXIST` to
  match Linux/POSIX spec
2019-10-17 11:33:56 +02:00
YAMAMOTO Yuji
d05561ff78 Fix deadlink to WASI API header (#431)
Fix documentation link to wasi-libc headers
2019-10-17 11:21:44 +02:00
Jakub Konka
d458fb6815 Clean up BSD vs Linux implementation details
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
2019-10-17 11:15:01 +02:00
Jakub Konka
f1f6b3780b Fixes CraneStation/wasmtime#396
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.
2019-10-17 10:38:58 +02:00
Marcin Mielniczuk
968fb19f17 Add a typesafe enum for file type 2019-10-15 19:25:05 +09:00
Marcin Mielniczuk
5dad532a43 Use cvt from the cvt crate in winx 2019-10-15 17:15:10 +09:00
Artur Jamro
872f6aa03d Fix opt_level builder flag (#411) 2019-10-10 12:14:45 -07:00
Dan Gohman
8e593506dc Don't run the spec_testsuite tests if the submodule isn't checked out. (#409)
* 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`.
2019-10-09 13:34:09 -07:00
Dan Gohman
fd3efad781 Various clippy fixes. (#403) 2019-10-09 13:32:52 -07:00
Dan Gohman
9465668199 Fix a TODO comment. (#405)
The parameter to defined_func_index is in the defined-function space, so calling
func_index on it works to translate it into module space.
2019-10-09 09:33:41 -07:00
Dan Gohman
6494728101 Update the README.md. (#410)
* 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.
2019-10-09 08:19:52 -07:00
Dan Gohman
8e1b44b29c Make more code work with no_std. (#407)
* Make more code work with no_std.

no_std support is still incomplete, but this patch takes care of the
bulk of the straightforward parts.
2019-10-08 16:53:32 -07:00
Dan Gohman
c0b37bb713 Merge pull request #406 from sunfishcode/wabt-workaround
Improve the workaround for what is now wabt issue #59.
2019-10-07 10:21:13 -07:00
Dan Gohman
292323229c Improve the workaround for what is now wabt issue #59.
wabt's ScriptParser doesn't appear to handle paths containing
directories, so just use basenames for now.
2019-10-07 06:00:43 -07:00
Dan Gohman
53291a8497 Merge pull request #397 from sunfishcode/integrate-lightbeam
Integrate Lightbeam
2019-10-04 20:06:04 -07:00
Dan Gohman
6ef46e0497 Use the Lightbeam cargo feature. 2019-10-04 18:12:06 -07:00
Marcin Mielniczuk
692bb27209 Correct the clippy::use_self lint where possible. (#114) 2019-10-04 18:10:30 -07:00
Dan Gohman
fb2a89a1b1 Fix compilation error by bringing in Lightbeam. 2019-10-04 17:36:14 -07:00
Dan Gohman
5ccdf13b11 Rename --always-cranelift to --cranelift.
Also, enable use of Lightbeam in wasm2obj.
2019-10-04 17:02:31 -07:00
Dan Gohman
36756613b8 Merge remote-tracking branch 'origin/master' into integrate-lightbeam 2019-10-04 16:11:12 -07:00
Jakub Konka
daa3c3aeef Update wasi-common version 2019-10-03 23:59:18 +02:00