Commit Graph

27 Commits

Author SHA1 Message Date
Andrew Brown
296ebc46fd Update wasmparser to 0.45.1 (#776) 2020-01-07 16:21:50 -06:00
Alex Crichton
d142a39113 Tweak some API doc generation (#772)
* Build docs with the nightly toolchain so [foo::bar] links work by
  default. This is a relatively new feature of rustdoc and I thought it
  was stabilized at this point but apparently it's not!

* Tweak some API docs on `wasmtime::Strategy`

* Use `--all` to build all local crate documentation instead of trying
  to list the number of local crates

* Tweak some documentation configuration to avoid warnings generated by
  Cargo.
2020-01-07 14:42:35 -06:00
Alex Crichton
787f50e107 Remove usage of Features from wasmtime::Config API (#763)
Instead expose a number of boolean accessors which doesn't require users
to construct a foreign `Features` type and allows us to decouple the API
of the `wasmtime` crate from the underlying implementation detail.
2020-01-06 17:34:48 -06:00
Alex Crichton
b9dc38f4e1 Remove need for HostRef<Engine> (#762)
This commit removes the need to use `HostRef<Engine>` in the Rust API.
Usage is retained in the C API in one location, but otherwise `Engine`
can always be used directly.

This is the first step of progress on #708 for the `Engine` type.
Changes here include:

* `Engine` is now `Clone`, and is documented as being cheap. It's not
  intended that cloning an engine creates a deep copy.
* `Engine` is now both `Send` and `Sync`, and asserted to be so.
* Usage of `Engine` in APIs no longer requires or uses `HostRef`.
2020-01-06 15:17:03 -06:00
Yury Delendik
681445b18b Fail with Trap in Instance::new() instead of Error (#683) 2019-12-30 16:25:16 -06:00
Andrew Brown
086ff63e6b Update wasmparser to 0.45.0 (#733) 2019-12-18 10:24:01 -06:00
Alex Crichton
5d399d48ab Disable some tests for crates in their manifest (#725)
Instead of passing `--exclude` in CI disable them in the manifest so
`--all` can work with fewer flags locally as well.
2019-12-16 11:00:50 -06:00
Alex Crichton
e134505b90 Refactor the types.rs types and structures (#681)
* Refactor the `types.rs` types and structures

A few changes applied along the way:

* Documentation added to most methods and types.
* Limits are now stored with the maximum as optional rather than a
  sentinel u32 value for `None`.
* The `Name` type was removed in favor of just using a bare `String`.
* The `Extern` prefix in the varaints of `ExternType` has been removed
  since it was redundant.
* Accessors of `ExternType` variants no longer panic, and unwrapping
  versions were added with "unwrap" in the name.
* Fields and methods named `r#type` were renamed to `ty` to avoid
  requiring a raw identifier to use them.

* Remove `fail-fast: false`

This was left around since the development of GitHub Actions for
wasmtime, but they're no longer needed!

* Fix compilation of the test-programs code

* Fix compilation of wasmtime-py package

* Run rustfmt
2019-12-06 16:19:55 -06:00
Yury Delendik
cc6e8e1af2 Move cranelift dependencies to wasmtime-environ (#669)
Groups all CL data structures into single dependency to be used accross wasmtime project.
2019-12-05 16:07:34 -06:00
Nick Fitzgerald
0fce2ac288 deps: Update wasmparser in most places (#670)
Doesn't update it in lightbeam.
2019-12-05 13:51:47 -06:00
Luiz Irber
5cdae1d394 use setuptools_scm for python version management (#627)
* use setuptools_scm for python version management

* add git dep for python wheel building

* if no tag is defined, default to dev

* any untagged version default to 0.0.1
2019-11-26 08:56:51 -06: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
Yury Delendik
ea56118651 Add/use create_wasi_instance() instead of instantiate_wasi(). (#571)
* Add/use create_wasi_instance() instead of instantiate_wasi().

* rm Result from Instance::from_handle
2019-11-15 16:48:05 -08:00
Dan Gohman
c5f998add2 Update the crates.io publishing scripts (#580)
* Fix fuzz target compilation.

* Bump version to 0.7.0

* Temporarily disable fuzz tests

Temporarily disable fuzz tests until https://github.com/bytecodealliance/cranelift/issues/1216 is resolved.

* Fix publish-all.sh to not modify the witx crate.

* Remove the "publish = false" attribute from Lightbeam.

* Add a README.md for wasmtime-interface-types.

* Remove the "rust" category.

This fixes the following warning:

warning: the following are not valid category slugs and were ignored: rust. Please see https://crates.io/category_slugs for the list of all category slugs.

* Mark wasmtime-cli as "publish = false".

* Sort the publishing rules in topological order.

Also, publish nightly-only crates with cargo +nightly.
2019-11-15 12:17:19 -08:00
Yury Delendik
36cb806c54 Use embedding api in python extension (#569)
Now embedding API is used in the Python extension, this allows us to remove ModuleData::invoke() from wasmtime-interface-types
2019-11-14 10:40:04 -06:00
Alex Crichton
8b0cfd9245 Squash improper_ctypes warnings on nightly
Lots more warnings are showing up on nightly compilers due to a recent
change. I've opened rust-lang/rust#66373 on the compiler side for this
as well.
2019-11-13 08:05:55 -08:00
Dan Gohman
c78196bd01 Update repository URLs for the Bytecode Alliance. (#550) 2019-11-12 09:18:59 -08:00
Nick Fitzgerald
01ab20e372 Bump cranelift deps to 0.50.0 2019-11-11 15:52:49 -08:00
Alex Crichton
cd8cc4d375 Enable multi-value in the Python extension (#541)
This commit enables the multi-value features in the Python extension
to be usable by-default with interface types. Additionally this removes
some code which panics on multi-value but doesn't end up getting used
today.
2019-11-11 17:19:33 -06:00
Alex Crichton
d9edb95218 Allow using WASI APIs in the Python extension (#533)
* Allow using WASI APIs in the Python extension

This commit adds support to the Python extension to load the WASI
implementation when a WASI module is seen allowing Python to load
WebAssembly modules that use WASI. This is pretty primitive right now
because there's no way to configure the environment/args/preopens/etc,
but it's hoped to be at least a start!

* rustfmt

* Refactor checks for the wasi module name

* Move the check into `wasmtime-wasi` itself
* Make it conservative for now and match anything that says `wasi*`
* Leave a `FIXME` for improving this later on

* Enable missing feature of winapi for `winx`
2019-11-11 11:09:45 -08:00
Dan Gohman
061b453255 Remove unneeded extern crate, macro_use, and tidy uses. 2019-11-08 17:55:38 -08:00
Dan Gohman
5b0031ece8 Use pointer::add instead of pointer::offset with a cast. 2019-11-08 17:15:37 -08:00
Dan Gohman
39b0d670c5 rustfmt and trim trailing whitespace. 2019-11-08 17:15:37 -08:00
Dan Gohman
a2b4148a91 General Cargo.toml cleanup. (#529)
* General Cargo.toml cleanup.

 - Remove travis-ci attributes.
 - Remove "experimental" badges from actively-developed crates.
 - Reflow some long lines.
 - Use dependency features consistently.
 - Add readme attributes

* Update WASI to the latest trunk.

This notably adds a .gitignore file for the WASI directory.
2019-11-08 17:22:37 -06:00
Dan Gohman
97d37e9369 Add a keywords field to Cargo.toml files. 2019-11-08 12:34:58 -08:00
Dan Gohman
22641de629 Initial reorg.
This is largely the same as #305, but updated for the current tree.
2019-11-08 06:35:40 -08:00