Commit Graph

175 Commits

Author SHA1 Message Date
Cedric Hutchings
bb5f063edf Replace 'traget' with 'target' (#687) 2019-12-09 07:28:32 -08:00
Jakub Konka
570bd7ec56 Add sections on WASI integration tests
This commit adds relevant sections on contributing new WASI
integration tests to `wasmtime`.
2019-12-04 22:27:24 +01:00
Nick Fitzgerald
06280401e0 docs: Wordsmith the specification-style tests contributing docs 2019-12-04 08:57:58 -08:00
Nick Fitzgerald
9c7079fd15 docs: Add a section about how to fuzz Wasmtime 2019-12-03 17:31:31 -08:00
Nick Fitzgerald
b74b0bc49e docs: Add a section about how to test Wasmtime 2019-12-03 17:31:10 -08:00
Nick Fitzgerald
aaa0dc4f19 docs: Add initial how-to-build documentation 2019-12-03 16:14:59 -08:00
Nick Fitzgerald
4ba52205d7 docs: Fill out the top-level contributing page a little 2019-12-03 15:15:43 -08:00
Nick Fitzgerald
14823de237 docs: Include the code of conduct directly into the mdbook
Also update the link to the organizational code of conduct so that it works in
the rendered mdbook as well as when viewed on github.
2019-12-03 15:15:43 -08:00
Josh Triplett
204b4d376a embed-rust: Find exported function by name rather than assuming index 0
While the wasm file has only one export, our introduction should set a
good example for how to find functions even for wasm files that have
multiple exports. Find the answer function by name rather than assuming
index 0.

Minor variable name change to avoid having to wrap the line.
2019-11-20 09:49:34 +01:00
Josh Triplett
4ab6445dae embed-rust: fix grammatical typo 2019-11-20 09:43:05 +01:00
Josh Triplett
2635ccb742 Rename the wasmtime_api library to match the containing wasmtime crate (#594)
* Rename the `wasmtime_api` library to match the containing `wasmtime` crate

Commit d9ca508f80 renamed the
`wasmtime-api` crate to `wasmtime`, but left the name of the library it
contains as `wasmtime_api`.

It's fairly unusual for a crate to contain a library with a different
name, and it results in rather confusing error messages for a user; if
you list `wasmtime = "0.7"` in `Cargo.toml`, you can't `use
wasmtime::*`, you have to `use wasmtime_api::*;`.

Rename the `wasmtime_api` library to `wasmtime`.

* Stop renaming wasmtime to api on imports

Various users renamed the crate formerly known as wasmtime_api to api,
and then used api:: prefixes everywhere; change those all to wasmtime::
and drop the renaming.
2019-11-19 14:47:39 -08:00
Alex Crichton
39e57e3e9a Migrate back to std:: stylistically (#554)
* Migrate back to `std::` stylistically

This commit moves away from idioms such as `alloc::` and `core::` as
imports of standard data structures and types. Instead it migrates all
crates to uniformly use `std::` for importing standard data structures
and types. This also removes the `std` and `core` features from all
crates to and removes any conditional checking for `feature = "std"`

All of this support was previously added in #407 in an effort to make
wasmtime/cranelift "`no_std` compatible". Unfortunately though this
change comes at a cost:

* The usage of `alloc` and `core` isn't idiomatic. Especially trying to
  dual between types like `HashMap` from `std` as well as from
  `hashbrown` causes imports to be surprising in some cases.
* Unfortunately there was no CI check that crates were `no_std`, so none
  of them actually were. Many crates still imported from `std` or
  depended on crates that used `std`.

It's important to note, however, that **this does not mean that wasmtime
will not run in embedded environments**. The style of the code today and
idioms aren't ready in Rust to support this degree of multiplexing and
makes it somewhat difficult to keep up with the style of `wasmtime`.
Instead it's intended that embedded runtime support will be added as
necessary. Currently only `std` is necessary to build `wasmtime`, and
platforms that natively need to execute `wasmtime` will need to use a
Rust target that supports `std`. Note though that not all of `std` needs
to be supported, but instead much of it could be configured off to
return errors, and `wasmtime` would be configured to gracefully handle
errors.

The goal of this PR is to move `wasmtime` back to idiomatic usage of
features/`std`/imports/etc and help development in the short-term.
Long-term when platform concerns arise (if any) they can be addressed by
moving back to `no_std` crates (but fixing the issues mentioned above)
or ensuring that the target in Rust has `std` available.

* Start filling out platform support doc
2019-11-18 22:04:06 -08:00
Daniel Salvadori
038a387471 Fix typo (#553) 2019-11-12 12:12:43 -08:00
Dan Gohman
c78196bd01 Update repository URLs for the Bytecode Alliance. (#550) 2019-11-12 09:18:59 -08:00
Alex Crichton
1530f2e1c6 Fill out book chapter on writing WebAssembly with Rust
* Cover `cargo wasi`
* Cover a "Hello, world!" binary
* Cover a "Hello, world!" library
* Cover a more advanced example with WebAssembly interface types
* Importing/exporting functionality basics
2019-11-11 15:09:36 -08:00
Dan Gohman
39b0d670c5 rustfmt and trim trailing whitespace. 2019-11-08 17:15:37 -08:00
Alex Crichton
cf0af20162 Move cache configuration documentation into book
Moves `CACHE_CONFIGURATION.md` into the `cli-cache.md` page of the
book. Additionally removes this from the release tarballs.
2019-11-08 13:29:01 -08:00
Dan Gohman
24218c960a Move CACHE_CONFIGURATION.md to the docs directory. 2019-11-08 09:56:02 -08:00
Dan Gohman
d9ca508f80 Rename wasmtime-api to wasmtime. 2019-11-08 06:43:07 -08:00
Dan Gohman
43b761ef5f Update the top-level README.md and embedding documentation. (#508)
* Update the top-level README.md and embedding documentation.

wasmtime-api is now the primary external API crate, so recommend that
instead of wasmtime-jit.

Also, enable wasmtime-api's C API by default, so that it shows up on
docs.rs, and to make it easier to use.

And, add basic embedding documentation and link to it from the
README.md. Credit to @yurydelendik for the content.

* Use the new wasm-c-api URL.

* Don't pass --features wasm-c-api, as it is now on by default.
2019-11-07 16:47:54 -08:00
Alex Crichton
bf526b62d3 Add book documentation skeleton and auto-publish from CI (#435)
This commit adds the skeleton of a new set of documentation for
`wasmtime` in the existing `docs` directory. This documentation is
organized and compiled with [mdbook] which the Rust project uses for
most of its own documentation as well. At a previous meeting we
brainstormed a rough skeleton of what the documentation in this book
would look like, and I've transcribed that here for an example of how
this is rendered and how it can be laid out. No actual documentation is
written yet.

This commit also additionally adds necessary support to auto-publish
both this book documentation and API documentation every time a commit
is pushed to the `master` branch. All HTML will be automatically pushed
to the `gh-pages` branch so long as the CI passes, and this should get
deployed to https://cranestation.github.io/wasmtime.

I've done a few dry-runs and I think this'll all work, but we'll likely
tweak a few things here and there after running this through CI to make
sure everything looks just as we'd like. My hope though is that after
this lands we can start actually filling out all the documentation and
being able to review it as well.

[mdbook]: https://crates.io/crates/mdbook
2019-10-29 15:55:51 +01: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
Paul Jackson
ab8707223c clarify posix_fallocate vs fd_allocate in docs 2019-09-25 21:21:57 -07:00
Zack Slayton
1497825173 Updating link to Fuchsia blog post 2019-09-06 14:19:17 -07:00
Artur Jamro
17d676ecbc Allow colons in Windows host paths (#235) 2019-08-06 16:44:26 -07:00
Dan Gohman
6b7ebfdddc Rust 1.36, with wasm32-wasi support, is now stable! 2019-07-10 12:27:21 -07:00
Van der Auwermeulen Grégoire
d900a5f6ef Update WASI-tutorial.md
consistent
2019-06-19 07:13:51 -07:00
Van der Auwermeulen Grégoire
3425553dc6 Update WASI-tutorial.md
Update README based on feedback
2019-06-19 07:13:51 -07:00
Van der Auwermeulen Grégoire
15b85dc285 Update WASI-tutorial.md 2019-06-19 07:13:51 -07:00
Sendil Kumar
ab8f8ef5d8 Adds an explicit way to use the args inside the WebAssembly Module 2019-06-19 07:10:56 -07:00
Dan Gohman
61eb4738fe wasi-sysroot is now named wasi-libc. (#167) 2019-05-31 10:15:52 +02:00
Van der Auwermeulen Grégoire
658b5aabcc Update WASI-tutorial.md 2019-05-21 06:45:28 -07:00
Dan Gohman
2b5be77fa5 "wasm32-unknown-wasi" is now "wasm32-wasi". 2019-05-13 21:40:56 -07:00
Alan Foster
1c0efd03b3 Add example of compiling wat and running with wasmtime 2019-05-12 15:12:54 +02:00
Jakub Konka
e41d333878 Update WASI tutorial with Rust howto as well 2019-05-02 22:02:19 +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
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
Joel Martin
b8fbae29e1 WASI-api.md: fix fsync -> fcntl 2019-04-18 13:25:40 -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
b37ab7d13e Fix a copy+pasto in the tutorial. 2019-04-07 05:16:55 -07:00
Dan Gohman
a1c123c3dd Fix grammar in documentation. 2019-04-04 16:14:28 -07:00
Dan Gohman
a6f31a2be3 Update Rust instructions, add a link to wasi-sysroot. 2019-03-31 06:29:23 -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