Commit Graph

383 Commits

Author SHA1 Message Date
katelyn martin
ab536126dd update WASI submodule (#3025)
* wasi-common: update wasi submodule

This updates the WASI submodule, pulling in changes to the witx crate,
now that there is a 0.9.1 version including some bug fixes. See
WebAssembly/WASI#434 for more information.

* wiggle: update witx dependencies

* publish: verify and vendor witx-cli

* adjust root workspace members

This commit removes some items from the root manifest's workspace
members array, and adds `witx-cli` to the root `workspace.exclude`
array.

The motivation for this stems from a cargo bug described in
rust-lang/cargo#6745: `workspace.exclude` does not work if it is nested
under a `workspace.members` path.

See WebAssembly/WASI#438 for the underlying change to the WASI submodule
which reorganized the `witx-cli` crate, and WebAssembly/WASI#398 for the
original PR introducing `witx-cli`.

See [this
comment](https://github.com/bytecodealliance/wasmtime/pull/3025#issuecomment-867741175)
for more details about the compilation errors, and failed alternative
approaches that necessitated this change.

N.B. This is not a functional change, these crates are still implicitly
workspace members as transitive dependencies, but this will allow us to
side-step the aforementioned cargo bug.

Co-Authored-By: Alex Crichton <alex@alexcrichton.com>

Co-authored-by: Alex Crichton <alex@alexcrichton.com>
2021-06-24 14:21:48 -05:00
Ulrich Weigand
c881c01cde Increase timeout for poll_oneoff tests
This increases the timeout from 50ms to 200ms, which makes the
tests reliably pass on my machine using the CI scripts againt
the s390x-linux-user qemu target.
2021-06-23 20:04:31 +02:00
Ulrich Weigand
1a865fb0f5 Fix WASI fd_readdir on big-endian (#3016)
This code assumes that the Dirent structure has the same memory
layout on the host (Rust code) as in wasm code.  This is not true
if the host is big-endian, as wasm is always little-endian.

Fixed by always byte-swapping Dirent fields to little-endian
before passing them on to wasm code.
2021-06-22 10:39:38 -05:00
Olivier Lemasle
a7dad4e38f Include READMEs in crates (#2987) 2021-06-15 06:40:45 -07:00
Alex Crichton
e8b8947956 Bump to 0.28.0 (#2972) 2021-06-09 14:00:13 -05:00
Alex Crichton
7a1b7cdf92 Implement RFC 11: Redesigning Wasmtime's APIs (#2897)
Implement Wasmtime's new API as designed by RFC 11. This is quite a large commit which has had lots of discussion externally, so for more information it's best to read the RFC thread and the PR thread.
2021-06-03 09:10:53 -05:00
Olivier Lemasle
33c791e1f5 Add license files
This commit adds LICENSE files to all **published** crates which do
not have it already (most of the crates have it).

Providing the license files is a requiment of the Apache 2.0 License.
2021-05-27 11:56:58 -07:00
Chris Fallin
ca39f954da Remove reference to non-existent README.md in wasi-tokio crate 2021-05-21 14:08:28 -07:00
Chris Fallin
95559c01aa Merge pull request from GHSA-hpqh-2wqx-7qp5
Fix spillslot reload of narrow values: zero-extend, don't sign-extend. Release v0.74.0 as security-patch release.
2021-05-21 12:01:55 -07:00
Pat Hickey
0f5bdc6497 only wasi_cap_std_sync and wasi_tokio need to define WasiCtxBuilders (#2917)
* wasmtime-wasi: re-exporting this WasiCtxBuilder was shadowing the right one

wasi-common's WasiCtxBuilder is really only useful wasi_cap_std_sync and
wasi_tokio to implement their own Builder on top of.

This re-export of wasi-common's is 1. not useful and 2. shadow's the
re-export of the right one in sync::*.

* wasi-common: eliminate WasiCtxBuilder, make the builder methods on WasiCtx instead

* delete wasi-common::WasiCtxBuilder altogether

just put those methods directly on &mut WasiCtx.

As a bonus, the sync and tokio WasiCtxBuilder::build functions
are no longer fallible!

* bench fixes

* more test fixes
2021-05-21 12:59:39 -05:00
Chris Fallin
88455007b2 Bump Wasmtime to v0.27.0 and Cranelift to v0.74.0. 2021-05-20 14:06:41 -07:00
Dan Gohman
05d57d8ded Update to cap-std 0.13.10 and system-interface 0.6.4.
This includes fixes for bytecodealliance/cap-std#169,
bytecodealliance/system-interface#15, and bytecodealliance/system-interface#16.
2021-05-12 13:21:32 -07:00
Pat Hickey
c81dbe498f try upping 20ms to 50ms timeouts... 2021-05-11 17:12:48 -07:00
Pat Hickey
e66909f710 wasi-tokio: increase timeout in poll_oneoff test here as well 2021-05-11 09:24:15 -07:00
Pat Hickey
f60ae73d15 Merge pull request #2832 from bytecodealliance/pch/wiggle_sync_shimming
wasi-common support for tokio, & wiggle support for async methods containing sync code
2021-05-07 17:43:42 -07:00
Pat Hickey
bae1a5693d 10ms here, and let it timeout in addition to ready? 2021-05-07 16:20:12 -07:00
Pat Hickey
548b6c5311 windows fixes 2021-05-07 15:51:33 -07:00
Pat Hickey
68fdadde26 tokio poll_oneoff test: CI needs more than 1ms to complete it 2021-05-07 15:19:02 -07:00
Dan Gohman
ec5d8016f7 On Windows, ignore files for which full_metadata fails.
On Windows, `metadata` computes only partial metadata results, which don't
include what WASI needs for the `inode` field in `readdir` results. cap-std
has a `full_metadata` function which is able to include this extra
information, however it has more strict access requirements, so it sometimes
fails even when plain `metadata` would succeed.

Make WASI's `readdir` silently skip over files that can't be accessed by
`full_metadata`. These files wouldn't be openable in any other way by
WASI programs, so the only benefit of listing them would be to
let applications know that they exist. This allows it to avoid failing
and avoid returning bogus results.

This is part of a fix for bytecodealliance/cap-std#169.
2021-05-07 14:47:39 -07:00
Pat Hickey
9b09272936 poll_oneoff: bound tests for time, rather than instant completion 2021-05-07 12:19:51 -07:00
Pat Hickey
b7593cb8fe Merge remote-tracking branch 'origin/main' into pch/wiggle_sync_shimming 2021-05-06 17:54:03 -07:00
Pat Hickey
e9f410d1db run_in_dummy_executor isnt unsafe, its just a bad idea 2021-05-06 16:25:12 -07:00
Pat Hickey
ff8bdc390b reuse cap-std-syncs windows scheduler without copypaste 2021-05-06 15:45:54 -07:00
Pat Hickey
3d9b98f1df fix example 2021-05-06 14:34:30 -07:00
Pat Hickey
e50f1b24a9 better name and comment 2021-05-06 11:24:48 -07:00
Pat Hickey
76be1959c4 explain! 2021-05-06 11:20:38 -07:00
Pat Hickey
f3ffd74566 dont depend on wiggle for just the one func 2021-05-06 11:19:25 -07:00
Pat Hickey
6616c1eaf1 fix warnings 2021-05-05 13:32:05 -07:00
Pat Hickey
9e04c5333c poll oneoff tests: what if we read a non-empty file? 2021-05-05 13:08:33 -07:00
Pat Hickey
e0f3423161 support windows 2021-05-04 14:28:45 -07:00
Pat Hickey
f76fe8b764 rewrite wasi-tokio as just an task::block_in_place wrapper on cap-std-sync 2021-05-04 14:15:50 -07:00
Pat Hickey
5ab8346a05 fix windows sync scheduler 2021-05-03 12:23:24 -07:00
Pat Hickey
3df9cddf10 better unit test 2021-05-03 11:59:30 -07:00
Pat Hickey
62c4f0d1f7 wasi-tokio kinda sorta working 2021-05-01 15:39:09 -07:00
Pat Hickey
7f34ccb909 various fixes to the design of Poll 2021-04-30 15:38:18 -07:00
Pat Hickey
b7efcbe80f jump through enough hoops for the poll lifetime to work out
you program rust for a few years and you think you're done tearing your
hair out over lifetimes, well, you'll find yourself wrong
2021-04-29 16:50:22 -07:00
Pat Hickey
b3e1ab4553 restructure Poll to hold a Table and fd instead of a RefMut<dyn WasiFile>
unfortunately, the borrow checker defeated me: changing the
RwSubscription file form a Ref to a RefMut turned into borrow checker
errors in the impl of the poll_oneoff trait method.

This implementation makes an end run by having Poll hold onto the table
and fd, and borrow the file at the site of use, rather than try to own
the RefMut. I have no idea why this convinces the borrow checker that
anything is different, but it does and I need to get this PR done and
I don't think comprimising on this internal abstraction is worth
fighting against
2021-04-28 11:56:48 -07:00
Pat Hickey
a532d0f379 subscribe to mut fds 2021-04-26 16:42:02 -07:00
Pat Hickey
867d2c9a35 follow the types 2021-04-26 15:49:27 -07:00
Pat Hickey
b307dce2ab add readable and writable futures to WasiFile trait 2021-04-26 14:43:16 -07:00
Pat Hickey
fa44ec2da2 tokio sched: comment out just to make it compile 2021-04-26 14:42:22 -07:00
Pat Hickey
3d3a2acc1b wasi-tokio: WIP need to port the sync scheduler into a spawn_blocking 2021-04-19 16:00:38 -07:00
Pat Hickey
675b579361 use AsyncSeek 2021-04-19 14:35:46 -07:00
Pat Hickey
d2a98ced53 use some better traits 2021-04-15 16:00:11 -07:00
Pat Hickey
9880d09f1f do some programming 2021-04-15 14:50:17 -07:00
Pat Hickey
33dbd4388c use tokio's File with a cap-std Dir 2021-04-15 11:39:11 -07:00
Pat Hickey
7202494e9d fix windows sched 2021-04-14 16:17:21 -07:00
Pat Hickey
c0e89b8da8 wasi-cap-std-sync: WasiFile and WasiDir converted to async_traits 2021-04-14 15:43:19 -07:00
Pat Hickey
564e43d1b3 WasiDir: make all operations async 2021-04-14 15:22:25 -07:00
Pat Hickey
00e58567d9 WasiFile: all operations are now async
only fn as_any(&self) -> &dyn Any doesnt get to be async.
2021-04-14 15:17:31 -07:00