Commit Graph

1329 Commits

Author SHA1 Message Date
Jakub Konka
3e94af81df Add Rust impl of wasmtime_ssp_fd_prestat_dir_name 2019-05-07 13:20:55 -07:00
Till Schneidereit
2549abd671 Merge pull request #133 from kubkon/kubkon/rust-tutorial
Update WASI tutorial with Rust howto as well
2019-05-05 15:10:05 +02:00
Jakub Konka
e41d333878 Update WASI tutorial with Rust howto as well 2019-05-02 22:02:19 +02:00
Till Schneidereit
e12f797c2c Merge pull request #132 from kubkon/patch-1
Add link to Rust version of the WASI tutorial
2019-05-02 15:56:01 +02:00
Jakub Konka
5c14d1eb6f Add link to Rust version of the WASI tutorial
I thought it might be useful for future WASI users to have the WASI tutorial written not only in C but also in Rust.

I'm also happy to keep the tutorial up to date with the current state of WASI target in Rust.
2019-05-02 15:49:30 +02:00
Jakub Konka
d6b2faeeb4 Modify fd_prestat to hold C-str together with its length 2019-05-01 15:32:28 -07:00
Jakub Konka
f7245f40a1 Port host::__wasi_preopentype_t to Rust 2019-05-01 15:32:28 -07:00
Jakub Konka
5c555406ca Add Rust impl of wasmtime_ssp_fd_prestat_get
In more detail, this commit:
* makes fd_prestat_get safe
* rewrites fd_prestats_get_entry in (safe) Rust
* creates helper macros for rwlock read lock and unlock
2019-05-01 15:32:28 -07:00
Dan Gohman
b0eab7398d Don't decode the incoming events to poll_oneoff. (#113)
The events array is an output-only array, so we don't need to decode its
contents.
2019-04-30 06:42:48 -07:00
Dan Gohman
ce3c0d98d3 Don't rewrite EBUSY to EINVAL in path_rename. 2019-04-29 23:36:21 -07:00
Dan Gohman
049c926e08 Handle set-size rights correctly when truncating a file.
If a path_open call is requesting __WASI_RIGHT_FD_FILESTAT_SET_SIZE,
interpret that as a request for write privleges. If it is requesting
O_TRUNC, require __WASI_RIGHT_PATH_FILESTAT_SET_SIZE, since this is
a path operation rather than a FD operation.
2019-04-29 23:34:34 -07:00
Dan Gohman
e62607e552 When path_open fails, set the output fd to -1. 2019-04-29 23:34:13 -07:00
Jakub Konka
86b7a52009 Port host::__wasi_errno_t errors to Rust
They are now blacklisted in the bindgen.
2019-04-29 23:33:40 -07:00
Jakub Konka
a51ffb6b6d Add Rust impl of wasmtime_ssp_sched_yield
Also, add Rust implementation of errno and convert_errno.
2019-04-29 23:33:40 -07:00
Dan Gohman
26cbbaab41 Clarify that path_open's path is a relative path. 2019-04-29 07:34:28 -07:00
Dan Gohman
29c2616484 Update the documentation about C/C++ toolchain limitations.
Document that `setjmp`/`longjmp` and C++ exceptions are unsupported, and
update the documentation about the function signature mismatch bug to
reflect that it's now just a warning rather than a fatal error.
2019-04-28 16:41:58 -07:00
Jakub Konka
69e44caa29 Add Rust impl of wasmtime_ssp_proc_exit 2019-04-27 09:06:41 -07:00
Dan Gohman
e906370661 Make path_open return ELOOP on O_NOFOLLOW|O_DIRECTORY on a symlink. 2019-04-26 14:09:12 -07:00
Dan Gohman
f10cd2f4b1 Don't allow a preopened file descriptor to be renamed over.
This is consistent with fd_close's behavior, and is likely temporary
until other options are designed.
2019-04-26 13:06:42 -07:00
Dan Gohman
7813cc9d2d Fix a trace logging message. 2019-04-23 12:08:06 -07:00
Jake Lang
a2eafd400f Document using wasmtime as a dependency in the README 2019-04-19 15:09:59 -07:00
Joel Martin
b8fbae29e1 WASI-api.md: fix fsync -> fcntl 2019-04-18 13:25:40 -07:00
Stefano Buliani
3351befb3b Allow access to memory_index and grow on Instance (#105)
* Changed `memory_grow` and `memory_index` in `Instance` struct to be `pub(crate)` and added the equivalent proxy methods to the `InstanceHandle` struct.
2019-04-16 19:59:54 -07:00
Dan Gohman
a99107203e Document the preopened file descriptor range. 2019-04-16 11:00:18 -07:00
Dan Gohman
d722b354db Miscellaneous tidying in the API docs.
- Don't include an extra "*" in type of Output arguments.
 - Fix the summary of environ_sizes_get.
 - Put fs_rights_base and fs_rights_inherinting arguments on separate lines.
 - Sort fd_prestat_dirname alphabetically before fd_prestat_get.
2019-04-16 11:00:18 -07:00
Dan Gohman
9b1cd4bc7b Document __wasi_preopentype_t and __wasi_prestat_t. 2019-04-16 11:00:18 -07:00
Dan Gohman
4262178cf5 Document the git clone --recurse-submodules requirement.
Currently, it's necessary to do this in order to obtain a lightbeam
checkout, in order to build wasmtime.

I'm very interested in learning about better ways to solve this problem.
2019-04-16 10:59:45 -07:00
Yury Delendik
07a6ca8f4e Hack to not allow inlining even when Rust wants to do it in release mode. 2019-04-10 11:15:38 -07:00
Dan Gohman
1f9167f44d Add a link to bindgen's documentation of the clang dependency. 2019-04-09 05:57:40 -07:00
Dan Gohman
f32581706f Document that cmake and clang are build dependencies. 2019-04-09 05:57:40 -07:00
Dan Gohman
7e11511abd Remove dead code. 2019-04-07 05:31:57 -07:00
Dan Gohman
b37ab7d13e Fix a copy+pasto in the tutorial. 2019-04-07 05:16:55 -07:00
Dan Gohman
07b83c5db3 Add __WASI_RIGHT_PATH_FILESTAT_SET_SIZE to RIGHTS_DIRECTORY_BASE.
This is a new right not present in CloudABI, which is why the code
previously didn't include it.
2019-04-05 15:09:14 -07:00
Dan Gohman
b509ca0aa5 Tidy up unused import warnings. 2019-04-05 14:07:28 -07:00
Dan Gohman
30dcf4aed6 Lightbeam requires nightly, so don't use cargo test --all.
For now, test all non-nightly-only packages individually, rather than
using cargo test --all. Lightbeam's tests are run separately if nightly
is available.
2019-04-05 13:42:54 -07:00
Jef
9bf6d73210 Integrate Lightbeam (#51)
* Integrate lightbeam
2019-04-05 12:42:54 -07:00
Dan Gohman
a1c123c3dd Fix grammar in documentation. 2019-04-04 16:14:28 -07:00
Henrik Rydgård
f5ebdb8e6a Get wasmtime building on Windows. (#92)
* Get wasmtime building on Windows.

Requires LLVM binaries from http://releases.llvm.org/download.html at
build time (bindgen).
2019-04-03 06:50:38 -07:00
Yury Delendik
474809f5f3 Support imports in wasm2obj 2019-04-02 22:02:24 -07:00
Dan Gohman
cc5efeb54d WASI: Simplify byref translation.
Avoid needlessly copying data from wasm into the host for output
parameters, and factor out the `.unwrap()` for translating pointers
when writing to output parameters.
2019-04-01 15:55:40 -07:00
Dan Gohman
5b77f95284 WASI: Implement translation for events and subscriptions. 2019-04-01 15:55:40 -07:00
Dan Gohman
7151c110d7 Implement decode/encode for __wasi_filestat_t. 2019-04-01 13:35:43 -07:00
Dan Gohman
dd0d71b18f Fix name name mangling of WASI functions in the JS polyfill.
Emscripten prefixes C functions with '_', so these functions end up
having 3 leading underscores.
2019-04-01 12:48:13 -07:00
Dan Gohman
a6f31a2be3 Update Rust instructions, add a link to wasi-sysroot. 2019-03-31 06:29:23 -07:00
Dan Gohman
7378a0bfbe Update Travis from trusty to xenial. (#84)
* Update Travis from trusty to xenial.

* Don't use getentropy on GLIBC < 2.25.
2019-03-31 05:46:32 -07:00
Dan Gohman
05a05551ba Pre-opened directory resources are now supported; update the docs. 2019-03-29 11:59:13 -07:00
Dan Gohman
f53ed6d8ee Document that random_get can block. 2019-03-29 11:59:09 -07:00
Dan Gohman
ab28cd9a2c Tidy up wording in the explanation of capabilities, and link to the tutorial. 2019-03-28 10:51:07 -07:00
Dan Gohman
5adbf58482 Fix grammar. 2019-03-28 10:47:46 -07:00
Dan Gohman
4fd7c4b931 Document the constraints on path_open's returned file descriptor.
Whether the downsides in POSIX and existing application compatibility
outweigh the benefits of thread safety remains an open question.
Right now, this note is just documenting the current behavior.
2019-03-28 10:42:48 -07:00