Commit Graph

367 Commits

Author SHA1 Message Date
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
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
Pat Hickey
025a1ecff4 wasi-common: snapshots 0 and 1 traits are all async now 2021-04-14 15:05:38 -07:00
Ulrich Weigand
1243cea455 Update cap-std dependency to 0.13.9
This fixes a build failure on s390x.
2021-04-14 14:11:46 -07:00
Pat Hickey
0127676621 wasi-cap-std-async is better named wasi-tokio 2021-04-14 14:06:36 -07:00
Pat Hickey
ac3b456523 wasi-cap-std-async: exactly like wasi-cap-std-sync but with a different WasiSched 2021-04-13 17:51:18 -07:00
Pat Hickey
22d18ffb0d cap-std-sync: async-trait e-paperwork 2021-04-13 17:51:18 -07:00
Pat Hickey
68daec7e7d wasi-common: WasiSched is an async trait now; poll_oneoff and sched_yield are async methods 2021-04-13 17:51:18 -07:00
Chris Fallin
6bec13da04 Bump versions: Wasmtime to 0.26.0, Cranelift to 0.73.0. 2021-04-05 10:48:42 -07:00
Pat Hickey
07245a8763 wasi-cap-std-sync: re-export Dir while we're at it 2021-03-25 17:05:02 -07:00
Pat Hickey
1d663bfd71 delete straggler InDataField 2021-03-24 11:19:12 -07:00
Pat Hickey
e6c7e00a52 wiggle-using crates: delete GuestErrorConversion 2021-03-24 10:39:06 -07:00
Pat Hickey
81dfb9c458 wasi: make WasiSched::sleep fallible
some systems do not support sleeping and may want to return EINVAL here.
2021-03-23 10:20:03 -07:00
Dan Gohman
2880dab8f8 Add a sleep function to the WasiSched trait. 2021-03-22 12:50:16 -07:00
Dan Gohman
6b40724d18 Support "sleep" forms of poll_oneoff.
Add support for `poll_oneoff` calls which just sleep on a relative
timeout. This fixes a bug handling code compiled with WASI libc's `sleep`
family of functions, which call `poll_oneoff` with a `CLOCK_REALTIME`
timer, which wasn't previously implemented.
2021-03-22 12:50:16 -07:00
Dan Gohman
cba0144612 Use min_by instead of sort_by when we only want the minimum element.
This is just a minor code simplification I happened to notice while
doing unrelated work on `poll_oneoff`.
2021-03-22 11:08:28 -07:00
Nick Fitzgerald
d081ef9c2e Bump Wasmtime to 0.25.0; Cranelift to 0.72.0 2021-03-16 11:02:56 -07:00
Christopher Serr
cc84c693a3 wasi-common: Timestamps should be in nanoseconds (#2717)
Sleeping takes 1000x longer than it should because the timestamps are
interpreted as microseconds by accident.
2021-03-10 09:09:34 -06:00