Commit Graph

1238 Commits

Author SHA1 Message Date
Pat Hickey
a46c2ad0aa split poll tests up, only one requires "real" stdio 2021-01-21 16:54:40 -08:00
Pat Hickey
12056885eb fix preopen dir to work on windows 2021-01-21 16:08:49 -08:00
Pat Hickey
16b42a5707 fix 2021-01-21 14:14:05 -08:00
Pat Hickey
85c3b73b4e stdio compiles on windows! 2021-01-21 13:51:18 -08:00
Pat Hickey
fcd00f5de1 move more deps to cap-std-sync, define own SystemTimeSpec 2021-01-21 12:35:55 -08:00
Pat Hickey
61885b7071 stub in windows scheduler, get to some interesting errors 2021-01-20 21:03:33 -08:00
Pat Hickey
7ec03631da inline only what we need of cap-std/system-interface traits 2021-01-20 20:53:44 -08:00
Pat Hickey
f3e40e2fc4 restructure cap-std impls into their own crate 2021-01-20 19:09:15 -08:00
Pat Hickey
016ed8966a poll now handles monotonic clocks, not system clocks
I initially had it backwards. It is not sensible to poll on a system
clock timeout because the system clock is not necessarily monotonic!
only a monotonic clock makes sense for a timeout.
2021-01-19 15:11:54 -08:00
Pat Hickey
21713d3468 Revert "TEMPORARY: poll_oneoff test uses CLOCKID_REALTIME instead of MONOTONIC"
This reverts commit f667263d9c.
2021-01-19 14:57:10 -08:00
Pat Hickey
657024bd0d latest system-interface provides ReadReady::num_ready_bytes 2021-01-19 14:39:20 -08:00
Pat Hickey
7f7a0be938 wasi-c2: implement a synchronous poll_oneoff in terms of yanix
doesnt work on unix yet! also breaks all the rules about using the
cap-std family instead of rawfds! but this is cool and im happy with it
2021-01-14 17:43:53 -08:00
Pat Hickey
b84c4d7488 poll_oneoff test: if you subscribe to a badf, the whole call fails with badf
rather than the results telling you an individual file was a badf.

why? i think the old behavior was too clever, and makes it harder to
write a scheduler.

* what should the call do when you pass it some badf and some not-badf?
i don't think anything besides exiting early is the correct answer.
* the results vector tells you something that the scheduler had to say
about the file, not about your inputs. the errno of the function
always says what the validity of the inputs was
2021-01-14 17:41:27 -08:00
Pat Hickey
f667263d9c TEMPORARY: poll_oneoff test uses CLOCKID_REALTIME instead of MONOTONIC
the scheduler does not support the monotonic clock yet, i will fix this
soon
2021-01-14 17:40:56 -08:00
Pat Hickey
7d7acc4614 poll_oneoff test: outline assertions
this makes the panic message have the line number, which
is handy
2021-01-14 17:40:04 -08:00
Pat Hickey
9a1ce1a272 TEMPORARY: inherit stdio for the wasi ctx
this is unfortunate but the poll_oneoff test insists on polling on stdio
handles. to undo this temporary fix later, lets rewrite the test to open
some regular files from the scratch directory and poll on them instead.
2021-01-14 17:38:43 -08:00
Pat Hickey
4b39a14163 fix tests in pipe 2021-01-14 14:14:41 -08:00
Pat Hickey
5c8efe868e need Any on WasiFile to upcast for AsRawFd 2021-01-14 13:39:01 -08:00
Pat Hickey
ea94d6f79d this is indeed a nice way to do refs! 2021-01-13 15:11:11 -08:00
Pat Hickey
7beb52a2bc i guess this is a way to do refs 2021-01-13 14:23:59 -08:00
Pat Hickey
8298ce9e4d clock sub, start with the read sub 2021-01-13 11:57:42 -08:00
Pat Hickey
e0e205f8d2 ctx builder: fix warnings, test harness 2021-01-13 11:07:06 -08:00
Léo Gaspard
932378eb7b reexport all the things required to implement WasiDir 2021-01-13 05:18:36 +01:00
Léo Gaspard
20bb4b211e Also reexport Error from wasmtime_wasi 2021-01-13 05:10:28 +01:00
Léo Gaspard
5d85216329 also reexport WasiDir from wasmtime_wasi 2021-01-13 05:05:37 +01:00
Léo Gaspard
2e035be60a make WasiCtxBuilder be an actual builder, allowing to call .build() at the end of a call chain 2021-01-13 04:57:16 +01:00
Léo Gaspard
f3156114c4 reserve keys 0, 1 and 2 for stdio 2021-01-13 04:24:02 +01:00
Léo Gaspard
7303793fa0 also expose WasiCtxBuilder 2021-01-13 04:10:12 +01:00
Pat Hickey
81065eba38 more scheduler 2021-01-12 17:42:59 -08:00
Pat Hickey
b79bdcee84 port subscriptions in from old branch 2021-01-12 15:55:25 -08:00
Pat Hickey
0e42c2e1d9 scaffold a scheduler 2021-01-12 12:07:00 -08:00
Pat Hickey
e7018bf6e0 wiggle flags are now bitflags! 2021-01-11 18:33:52 -08:00
Pat Hickey
b53aecb367 Merge branch 'pch/wiggle_flags_bitflags' into pch/wasi_common_cap_std 2021-01-11 18:31:43 -08:00
Pat Hickey
75a9dc7fe2 wasi-common: wiggle flags are now bitflags!
this mostly mechanical change is just getting rid of passing to
`contains` by reference.
2021-01-11 18:27:55 -08:00
Pat Hickey
ed44a19e5e wiggle: use bitflags to generate flags
more consistient with the rest of the ecosystem.
2021-01-11 18:20:57 -08:00
Pat Hickey
e2fb99af86 wiggle: depend on bitflags, and re-export it. 2021-01-11 18:04:43 -08:00
Pat Hickey
94467bcd9a wiggle: bugfix, generated code should use Names::runtime_mod not wiggle
as the crate from which these deps come.

I worked around this in lucet, but I'll be able to revert that
workaround.
2021-01-11 18:03:48 -08:00
Pat Hickey
4a54db0837 derive debug and clone on DirFdStat / FdStat 2021-01-11 17:58:53 -08:00
Pat Hickey
d56d2f0219 directory seek test: code does not agree with comment. Fix code.
the directory was opened with the seek right, and this test says that it
was asserting that the seek right was present. However, the test was
actually asserting that the seek right was *not* present.

This fixes the code of the test, because I believe the comment is
correct.
2021-01-11 17:58:32 -08:00
Pat Hickey
b1d32f419c use bitflags crate to define bitflags, rather than by hand 2021-01-11 17:48:41 -08:00
Pat Hickey
3863b8b3d3 re-organize failures todo list 2021-01-11 17:11:50 -08:00
Pat Hickey
4044977f50 just ignore nofollow on links for now 2021-01-11 17:05:09 -08:00
Pat Hickey
f084cf1fd0 failure to create trailing slash symlink to file can be EEXIST or ENOTDIR 2021-01-11 15:56:13 -08:00
Pat Hickey
932ba6b4f3 need DirExt::hard_link_nofollow to implement path_link properly 2021-01-11 15:47:57 -08:00
Pat Hickey
09861c20db symlink-related tests: accept either ELOOP or ENOTDIR
when opening a symlink loop as directory, or nofollow opening a valid
symlink as directory.
2021-01-11 15:35:48 -08:00
Pat Hickey
2d2e6d16a1 Dir::open_file, open_dir: correct symlink following 2021-01-11 15:15:54 -08:00
Nick Fitzgerald
3068d55fa1 wasi-nn: Fix keyword form in Cargo.toml metadata
Keywords may not have spaces, apparently.
2021-01-11 10:46:00 -08:00
Andrew Brown
2adb0e8964 security: upgrade smallvec to 1.6.1
Fixes advisory https://rustsec.org/advisories/RUSTSEC-2021-0003.
2021-01-08 16:54:54 -08:00
Yury Delendik
3580205f12 [Cranelift][Atomics] Add address folding for atomic notify/wait. (#2556)
* fold address in wasm wait and notify ops

* add atomics addr folding tests
2021-01-08 11:55:21 -06:00
Pat Hickey
4a6e92f52f upgrade to cap-std 0.9 2021-01-07 16:47:26 -08:00